แก้ไขบุตร
This commit is contained in:
parent
291d3199d2
commit
0114e41c3a
7 changed files with 511 additions and 106 deletions
|
|
@ -167,114 +167,11 @@ export class ProfileFamilyHistory extends EntityBase {
|
|||
@ManyToOne(() => Profile, (v) => v.profileFamily)
|
||||
profile: Profile;
|
||||
|
||||
@OneToMany(() => ProfileChildrenHistory, (v) => v.profileFamilyHistory)
|
||||
profileChildrenHistories: ProfileChildrenHistory[];
|
||||
|
||||
@ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileFamilys)
|
||||
@JoinColumn({ name: "profileEmployeeId" })
|
||||
profileEmployee: ProfileEmployee;
|
||||
}
|
||||
|
||||
@Entity("profileChildren")
|
||||
export class ProfileChildren extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
default: null,
|
||||
comment: "อาชีพบุตร",
|
||||
})
|
||||
childrenCareer: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
default: null,
|
||||
comment: "ชื่อบุตร",
|
||||
})
|
||||
childrenFirstName: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
default: null,
|
||||
comment: "นามสกุลบุตร",
|
||||
})
|
||||
childrenLastName: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
default: null,
|
||||
comment: "คำนำหน้าบุตร",
|
||||
})
|
||||
childrenPrefix: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
default: null,
|
||||
type: "boolean",
|
||||
comment: "มีชีวิตบุตร",
|
||||
})
|
||||
childrenLive: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
default: null,
|
||||
comment: "เลขที่บัตรประชาชนบุตร",
|
||||
})
|
||||
childrenCitizenId: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
type: "uuid",
|
||||
comment: "คีย์นอก(FK) ของตาราง Profile",
|
||||
default: null,
|
||||
})
|
||||
profileId: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง ProfileEmployee",
|
||||
default: null,
|
||||
})
|
||||
profileEmployeeId: string;
|
||||
|
||||
@ManyToOne(() => Profile, (v) => v.profileFamily, { onDelete: "CASCADE" })
|
||||
profile: Profile;
|
||||
|
||||
@OneToMany(() => ProfileChildrenHistory, (v) => v.profileChildren)
|
||||
histories: Profile;
|
||||
|
||||
@ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileChildrens)
|
||||
@JoinColumn({ name: "profileEmployeeId" })
|
||||
profileEmployee: ProfileEmployee;
|
||||
}
|
||||
|
||||
@Entity("profileChildrenHistory")
|
||||
export class ProfileChildrenHistory extends ProfileChildren {
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
type: "uuid",
|
||||
comment: "คีย์นอก(FK) ของตาราง Profile",
|
||||
default: null,
|
||||
})
|
||||
profileFamilyHistoryId: string;
|
||||
|
||||
@ManyToOne(() => ProfileFamilyHistory, (v) => v.profileChildrenHistories, { onDelete: "CASCADE" })
|
||||
profileFamilyHistory: ProfileFamilyHistory;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
type: "uuid",
|
||||
comment: "คีย์นอก(FK) ของตาราง Profile",
|
||||
default: null,
|
||||
})
|
||||
profileChildrenId: string;
|
||||
|
||||
@ManyToOne(() => ProfileChildren, (v) => v.histories, { onDelete: "CASCADE" })
|
||||
profileChildren: ProfileChildren;
|
||||
}
|
||||
|
||||
export type CreateChildren = {
|
||||
childrenCareer: string;
|
||||
childrenFirstName: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue