diff --git a/src/entities/ProfileAbility.ts b/src/entities/ProfileAbility.ts index 697c34e3..261484a8 100644 --- a/src/entities/ProfileAbility.ts +++ b/src/entities/ProfileAbility.ts @@ -18,7 +18,7 @@ export class ProfileAbility extends EntityBase { default: false, }) isActive: boolean; - + @Column({ nullable: true, comment: "หมายเหตุ", @@ -67,7 +67,10 @@ export class ProfileAbility extends EntityBase { }) field: string; - @OneToMany(() => ProfileAbilityHistory, (profileAbilityHistory) => profileAbilityHistory.histories) + @OneToMany( + () => ProfileAbilityHistory, + (profileAbilityHistory) => profileAbilityHistory.histories, + ) profileAbilityHistorys: ProfileAbilityHistory[]; @ManyToOne(() => Profile, (profile) => profile.profileAbilities) @@ -76,29 +79,23 @@ export class ProfileAbility extends EntityBase { } export class CreateProfileAbility { - @Column("uuid") profileId: string | null; - - @Column() isActive: boolean; - - @Column() remark: string | null; - - @Column() detail: string | null; - - @Column() reference: string | null; - - @Column() dateStart: Date | null; - - @Column() dateEnd: Date | null; - - @Column() field: string | null; } -export type UpdateProfileAbility = Partial; +export type UpdateProfileAbility = { + profileId: string | null; + isActive: boolean; + remark: string | null; + detail: string | null; + reference: string | null; + dateStart?: Date | null; + dateEnd?: Date | null; + field: string | null; +}; diff --git a/src/entities/ProfileAbilityHistory.ts b/src/entities/ProfileAbilityHistory.ts index 61f6364b..04974946 100644 --- a/src/entities/ProfileAbilityHistory.ts +++ b/src/entities/ProfileAbilityHistory.ts @@ -5,13 +5,12 @@ import { ProfileAbility } from "./ProfileAbility"; @Entity("profileAbilityHistory") export class ProfileAbilityHistory extends EntityBase { - @Column({ comment: "สถานะการใช้งาน", default: false, }) isActive: boolean; - + @Column({ nullable: true, comment: "หมายเหตุ", @@ -72,32 +71,3 @@ export class ProfileAbilityHistory extends EntityBase { @JoinColumn({ name: "profileAbilityId" }) histories: ProfileAbility; } - -export class CreateProfileAbilityHistory { - - @Column() - isActive: boolean; - - @Column() - remark: string | null; - - @Column() - detail: string | null; - - @Column() - reference: string | null; - - @Column() - dateStart: Date | null; - - @Column() - dateEnd: Date | null; - - @Column() - field: string | null; - - @Column("uuid") - ProfileAbilityId: string | null; -} - -export type UpdateProfileAbilityHistory = Partial; diff --git a/src/entities/ProfileAssessment.ts b/src/entities/ProfileAssessment.ts index d69d67ab..b6c7f5e5 100644 --- a/src/entities/ProfileAssessment.ts +++ b/src/entities/ProfileAssessment.ts @@ -22,11 +22,11 @@ export class ProfileAssessment extends EntityBase { @Column({ nullable: true, comment: "ชื่อแบบประเมิน", - type: "text", + type: "text", default: null, }) name: string; - + @Column({ nullable: true, type: "datetime", @@ -83,7 +83,10 @@ export class ProfileAssessment extends EntityBase { }) pointSumTotal: number; - @OneToMany(() => ProfileAssessmentHistory, (profileAssessmentHistory) => profileAssessmentHistory.histories) + @OneToMany( + () => ProfileAssessmentHistory, + (profileAssessmentHistory) => profileAssessmentHistory.histories, + ) profileAssessmentHistorys: ProfileAssessmentHistory[]; @ManyToOne(() => Profile, (profile) => profile.profileAssessments) @@ -92,35 +95,27 @@ export class ProfileAssessment extends EntityBase { } export class CreateProfileAssessment { - @Column("uuid") profileId: string | null; - - @Column() isActive: boolean; - - @Column() name: string | null; - - @Column() date: Date | null; - - @Column() point1: number | null; - - @Column() point1Total: number | null; - - @Column() point2: number | null; - - @Column() point2Total: number | null; - - @Column() pointSum: number | null; - - @Column() pointSumTotal: number | null; } -export type UpdateProfileAssessment = Partial; +export type UpdateProfileAssessment = { + profileId: string | null; + isActive: boolean; + name: string | null; + date?: Date | null; + point1: number | null; + point1Total: number | null; + point2: number | null; + point2Total: number | null; + pointSum: number | null; + pointSumTotal: number | null; +}; diff --git a/src/entities/ProfileAssessmentHistory.ts b/src/entities/ProfileAssessmentHistory.ts index 2e8b9acf..46c5d533 100644 --- a/src/entities/ProfileAssessmentHistory.ts +++ b/src/entities/ProfileAssessmentHistory.ts @@ -5,7 +5,6 @@ import { ProfileAssessment } from "./ProfileAssessment"; @Entity("profileAssessmentHistory") export class ProfileAssessmentHistory extends EntityBase { - @Column({ comment: "สถานะการใช้งาน", default: false, @@ -15,11 +14,11 @@ export class ProfileAssessmentHistory extends EntityBase { @Column({ nullable: true, comment: "ชื่อแบบประเมิน", - type: "text", + type: "text", default: null, }) name: string; - + @Column({ nullable: true, type: "datetime", @@ -83,43 +82,11 @@ export class ProfileAssessmentHistory extends EntityBase { default: null, }) profileAssessmentId: string; - - @ManyToOne(() => ProfileAssessment, (profileAssessment) => profileAssessment.profileAssessmentHistorys) + + @ManyToOne( + () => ProfileAssessment, + (profileAssessment) => profileAssessment.profileAssessmentHistorys, + ) @JoinColumn({ name: "profileAssessmentId" }) histories: ProfileAssessment; } - -export class CreateProfileAssessmentHistory { - - @Column() - isActive: boolean; - - @Column() - name: string | null; - - @Column() - date: Date | null; - - @Column() - point1: number | null; - - @Column() - point1Total: number | null; - - @Column() - point2: number | null; - - @Column() - point2Total: number | null; - - @Column() - pointSum: number | null; - - @Column() - pointSumTotal: number | null; - - @Column("uuid") - profileAssessmentId: string | null; -} - -export type UpdateProfileAssessmentHistory = Partial; diff --git a/src/entities/ProfileDiscipline.ts b/src/entities/ProfileDiscipline.ts index 0a4fbcc1..f6a332f0 100644 --- a/src/entities/ProfileDiscipline.ts +++ b/src/entities/ProfileDiscipline.ts @@ -41,7 +41,7 @@ export class ProfileDiscipline extends EntityBase { default: null, }) detail: string; - + @Column({ nullable: true, type: "datetime", @@ -66,7 +66,10 @@ export class ProfileDiscipline extends EntityBase { }) unStigma: string; - @OneToMany(() => ProfileDisciplineHistory, (profileDisciplineHistory) => profileDisciplineHistory.histories) + @OneToMany( + () => ProfileDisciplineHistory, + (profileDisciplineHistory) => profileDisciplineHistory.histories, + ) profileDisciplineHistories: ProfileDisciplineHistory[]; @ManyToOne(() => Profile, (profile) => profile.profileDiscipline) @@ -75,30 +78,23 @@ export class ProfileDiscipline extends EntityBase { } export class CreateProfileDiscipline { - - @Column() date: Date | null; - - @Column() profileId: string; - - @Column() isActive: boolean | null; - - @Column() - level: string | null; - - @Column() + level: string | null; detail: string | null; - - @Column() refCommandDate: Date | null; - - @Column() refCommandNo: string | null; - - @Column() unStigma: string | null; } -export type UpdateProfileDiscipline = Partial; \ No newline at end of file +export type UpdateProfileDiscipline = { + date?: Date | null; + profileId: string; + isActive: boolean | null; + level: string | null; + detail: string | null; + refCommandDate?: Date | null; + refCommandNo: string | null; + unStigma: string | null; +}; diff --git a/src/entities/ProfileDuty.ts b/src/entities/ProfileDuty.ts index fcb869f3..da3e5749 100644 --- a/src/entities/ProfileDuty.ts +++ b/src/entities/ProfileDuty.ts @@ -76,29 +76,23 @@ export class ProfileDuty extends EntityBase { } export class CreateProfileDuty { - @Column("uuid") profileId: string | null; - - @Column() isActive: boolean; - - @Column() dateStart: Date | null; - - @Column() dateEnd: Date | null; - - @Column() detail: string | null; - - @Column() reference: string | null; - - @Column() refCommandDate: Date | null; - - @Column() refCommandNo: string | null; } -export type UpdateProfileDuty = Partial; +export type UpdateProfileDuty = { + profileId: string | null; + isActive: boolean; + dateStart?: Date | null; + dateEnd?: Date | null; + detail: string | null; + reference: string | null; + refCommandDate?: Date | null; + refCommandNo: string | null; +}; diff --git a/src/entities/ProfileDutyHistory.ts b/src/entities/ProfileDutyHistory.ts index 8f7da298..989cefba 100644 --- a/src/entities/ProfileDutyHistory.ts +++ b/src/entities/ProfileDutyHistory.ts @@ -5,7 +5,6 @@ import { ProfileDuty } from "./ProfileDuty"; @Entity("profileDutyHistory") export class ProfileDutyHistory extends EntityBase { - @Column({ comment: "สถานะการใช้งาน", default: false, @@ -68,37 +67,7 @@ export class ProfileDutyHistory extends EntityBase { }) profileDutyId: string; - @ManyToOne(() => ProfileDuty, (profileDuty) => profileDuty.profileDutyHistories) @JoinColumn({ name: "profileDutyId" }) histories: ProfileDuty; } - -export class CreateProfileDutyHistory { - - @Column() - isActive: boolean; - - @Column() - dateStart: Date | null; - - @Column() - dateEnd: Date | null; - - @Column() - detail: string | null; - - @Column() - reference: string | null; - - @Column() - refCommandDate: Date | null; - - @Column() - refCommandNo: string | null; - - @Column("uuid") - profileDutyId: string | null; -} - -export type UpdateProfileDutyHistory = Partial; diff --git a/src/entities/ProfileTraining.ts b/src/entities/ProfileTraining.ts index 1866d0ad..30b1256d 100644 --- a/src/entities/ProfileTraining.ts +++ b/src/entities/ProfileTraining.ts @@ -104,8 +104,11 @@ export class ProfileTraining extends EntityBase { default: null, }) isDate: boolean; - - @OneToMany(() => ProfileTrainingHistory, (profileTrainingHistory) => profileTrainingHistory.histories) + + @OneToMany( + () => ProfileTrainingHistory, + (profileTrainingHistory) => profileTrainingHistory.histories, + ) profileTrainingHistories: ProfileTrainingHistory[]; @ManyToOne(() => Profile, (profile) => profile.profileTrainings) @@ -114,44 +117,33 @@ export class ProfileTraining extends EntityBase { } export class CreateProfileTraining { - @Column("uuid") profileId: string | null; - - @Column() isActive: boolean; - - @Column() startDate: Date | null; - - @Column() endDate: Date | null; - - @Column() - numberOrder: string | null; - - @Column() + numberOrder: string | null; topic: string | null; - - @Column() place: string | null; - - @Column() dateOrder: Date | null; - - @Column() department: string | null; - - @Column() duration: string | null; - - @Column() name: string | null; - - @Column() yearly: number | null; - - @Column() isDate: boolean | null; } -export type UpdateProfileTraining = Partial; +export type UpdateProfileTraining = { + profileId: string | null; + isActive: boolean; + startDate?: Date | null; + endDate?: Date | null; + numberOrder: string | null; + topic: string | null; + place: string | null; + dateOrder?: Date | null; + department: string | null; + duration: string | null; + name: string | null; + yearly: number | null; + isDate: boolean | null; +}; diff --git a/src/entities/ProfileTrainingHistory.ts b/src/entities/ProfileTrainingHistory.ts index fe0e076e..cfab7363 100644 --- a/src/entities/ProfileTrainingHistory.ts +++ b/src/entities/ProfileTrainingHistory.ts @@ -109,46 +109,3 @@ export class ProfileTrainingHistory extends EntityBase { @JoinColumn({ name: "profileTrainingId" }) histories: ProfileTraining; } - -export class CreateProfileTrainingHistory { - @Column() - isActive: boolean; - - @Column() - startDate: Date | null; - - @Column() - endDate: Date | null; - - @Column() - numberOrder: string | null; - - @Column() - topic: string | null; - - @Column() - place: string | null; - - @Column() - dateOrder: Date | null; - - @Column() - department: string | null; - - @Column() - duration: string | null; - - @Column() - name: string | null; - - @Column() - yearly: number | null; - - @Column() - isDate: boolean | null; - - @Column("uuid") - profileTrainingId: string | null; -} - -export type UpdateProfileTrainingHistory = Partial;