diff --git a/src/entities/ProfileFamilyCouple.ts b/src/entities/ProfileFamilyCouple.ts index 0157177c..243542f6 100644 --- a/src/entities/ProfileFamilyCouple.ts +++ b/src/entities/ProfileFamilyCouple.ts @@ -90,11 +90,8 @@ export class ProfileFamilyCouple extends EntityBase { }) profileEmployeeId: string; - @OneToMany( - () => ProfileFamilyCoupleHistory, - (v) => v.histories, - ) - profileFamilyCouple: ProfileFamilyCoupleHistory[]; + @OneToMany(() => ProfileFamilyCoupleHistory, (v) => v.profileFamilyCouple) + histories: ProfileFamilyCoupleHistory[]; @ManyToOne(() => Profile, (v) => v.profileFamilyCouple) @JoinColumn({ name: "profileId" }) diff --git a/src/entities/ProfileFamilyCoupleHistory.ts b/src/entities/ProfileFamilyCoupleHistory.ts index d831bf3a..a350fc59 100644 --- a/src/entities/ProfileFamilyCoupleHistory.ts +++ b/src/entities/ProfileFamilyCoupleHistory.ts @@ -7,54 +7,78 @@ export class ProfileFamilyCoupleHistory extends EntityBase { @Column({ nullable: true, default: null, - comment: "คำนำหน้าบิดา", + type: "boolean", }) - fatherPrefix: string; + couple: boolean; @Column({ nullable: true, default: null, - comment: "ชื่อบิดา", + comment: "คำนำหน้าคู่สมรส", }) - fatherFirstName: string; + couplePrefix: string; @Column({ nullable: true, default: null, - comment: "นามสกุลบิดา", + comment: "ชื่อคู่สมรส", }) - fatherLastName: string; + coupleFirstName: string; @Column({ nullable: true, default: null, - comment: "อาชีพบิดา", + comment: "นามสกุลคู่สมรส", }) - fatherCareer: string; + coupleLastName: string; @Column({ nullable: true, default: null, - comment: "เลขที่บัตรประชาชนบิดา", + comment: "นามสกุลคู่สมรส(เดิม)", }) - fatherCitizenId: string; + coupleLastNameOld: string; @Column({ nullable: true, default: null, - comment: "มีชีวิตบิดา", + comment: "อาชีพคู่สมรส", }) - fatherLive: boolean; + coupleCareer: string; + @Column({ + nullable: true, + default: null, + length: 13, + comment: "เลขที่บัตรประชาชนคู่สมรส", + }) + coupleCitizenId: string; + + @Column({ + nullable: true, + default: null, + type: "boolean", + comment: "มีชีวิตคู่สมรส", + }) + coupleLive: boolean; + + @Column({ + nullable: true, + comment: "ความสัมพันธ์", + length: 40, + default: null, + }) + relationship: string; + @Column({ nullable: true, length: 40, - comment: "คีย์นอก(FK)ของตาราง ProfileFamilyFather", + comment: "คีย์นอก(FK)ของตาราง ProfileFamilyCouple", default: null, }) profileFamilyCoupleId: string; - @ManyToOne(() => ProfileFamilyCouple, (v) => v.profileFamilyCouple) + @ManyToOne(() => ProfileFamilyCouple, (v) => v.histories) @JoinColumn({ name: "profileFamilyCoupleId" }) - histories: ProfileFamilyCouple; + profileFamilyCouple: ProfileFamilyCouple; } diff --git a/src/entities/ProfileFamilyFather.ts b/src/entities/ProfileFamilyFather.ts index 8b56d64e..407afb2d 100644 --- a/src/entities/ProfileFamilyFather.ts +++ b/src/entities/ProfileFamilyFather.ts @@ -66,11 +66,8 @@ export class ProfileFamilyFather extends EntityBase { }) profileEmployeeId: string; - @OneToMany( - () => ProfileFamilyFatherHistory, - (v) => v.histories, - ) - profileFamilyFather: ProfileFamilyFatherHistory[]; + @OneToMany(() => ProfileFamilyFatherHistory, (v) => v.profileFamilyFather) + histories: ProfileFamilyFatherHistory[]; @ManyToOne(() => Profile, (v) => v.profileFamilyFather) @JoinColumn({ name: "profileId" }) diff --git a/src/entities/ProfileFamilyFatherHistory.ts b/src/entities/ProfileFamilyFatherHistory.ts index dd99f6be..3c471b2c 100644 --- a/src/entities/ProfileFamilyFatherHistory.ts +++ b/src/entities/ProfileFamilyFatherHistory.ts @@ -54,7 +54,7 @@ export class ProfileFamilyFatherHistory extends EntityBase { }) profileFamilyFatherId: string; - @ManyToOne(() => ProfileFamilyFather, (v) => v.profileFamilyFather) + @ManyToOne(() => ProfileFamilyFather, (v) => v.histories) @JoinColumn({ name: "profileFamilyFatherId" }) - histories: ProfileFamilyFather; + profileFamilyFather: ProfileFamilyFather; } diff --git a/src/entities/ProfileFamilyMother.ts b/src/entities/ProfileFamilyMother.ts index c143237d..93bd5b4c 100644 --- a/src/entities/ProfileFamilyMother.ts +++ b/src/entities/ProfileFamilyMother.ts @@ -66,11 +66,8 @@ export class ProfileFamilyMother extends EntityBase { }) profileEmployeeId: string; - @OneToMany( - () => ProfileFamilyMotherHistory, - (v) => v.histories, - ) - profileFamilyMother: ProfileFamilyMotherHistory[]; + @OneToMany(() => ProfileFamilyMotherHistory, (v) => v.profileFamilyMother) + histories: ProfileFamilyMotherHistory[]; @ManyToOne(() => Profile, (v) => v.profileFamilyMother) @JoinColumn({ name: "profileId" }) diff --git a/src/entities/ProfileFamilyMotherHistory.ts b/src/entities/ProfileFamilyMotherHistory.ts index 90fd6a90..f43b667d 100644 --- a/src/entities/ProfileFamilyMotherHistory.ts +++ b/src/entities/ProfileFamilyMotherHistory.ts @@ -4,7 +4,6 @@ import { ProfileFamilyMother } from "./ProfileFamilyMother"; @Entity("profileFamilyMotherHistory") export class ProfileFamilyMotherHistory extends EntityBase { - @Column({ nullable: true, default: null, @@ -55,7 +54,7 @@ export class ProfileFamilyMotherHistory extends EntityBase { }) profileFamilyMotherId: string; - @ManyToOne(() => ProfileFamilyMother, (v) => v.profileFamilyMother) + @ManyToOne(() => ProfileFamilyMother, (v) => v.histories) @JoinColumn({ name: "profileFamilyMotherId" }) - histories: ProfileFamilyMother; + profileFamilyMother: ProfileFamilyMother; }