family entity (father, mother, couple)

This commit is contained in:
Bright 2024-05-14 17:39:32 +07:00
parent 291d3199d2
commit 968842557a
8 changed files with 575 additions and 0 deletions

View file

@ -0,0 +1,60 @@
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { ProfileFamilyFather } from "./ProfileFamilyFather";
@Entity("profileFamilyFatherHistory")
export class ProfileFamilyFatherHistory extends EntityBase {
@Column({
nullable: true,
default: null,
comment: "คำนำหน้าบิดา",
})
fatherPrefix: string;
@Column({
nullable: true,
default: null,
comment: "ชื่อบิดา",
})
fatherFirstName: string;
@Column({
nullable: true,
default: null,
comment: "นามสกุลบิดา",
})
fatherLastName: string;
@Column({
nullable: true,
default: null,
comment: "อาชีพบิดา",
})
fatherCareer: string;
@Column({
nullable: true,
default: null,
comment: "เลขที่บัตรประชาชนบิดา",
})
fatherCitizenId: string;
@Column({
nullable: true,
default: null,
comment: "มีชีวิตบิดา",
})
fatherLive: boolean;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง ProfileFamilyFather",
default: null,
})
profileFamilyFatherId: string;
@ManyToOne(() => ProfileFamilyFather, (v) => v.profileFamilyFather)
@JoinColumn({ name: "profileFamilyFatherId" })
histories: ProfileFamilyFather;
}