hrms-api-org/src/entities/ProfileFamilyMotherHistory.ts
2024-05-15 14:34:21 +07:00

60 lines
1.4 KiB
TypeScript

import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { ProfileFamilyMother } from "./ProfileFamilyMother";
@Entity("profileFamilyMotherHistory")
export class ProfileFamilyMotherHistory extends EntityBase {
@Column({
nullable: true,
default: null,
comment: "คำนำหน้ามารดา",
})
motherPrefix: string;
@Column({
nullable: true,
default: null,
comment: "ชื่อมารดา",
})
motherFirstName: string;
@Column({
nullable: true,
default: null,
comment: "นามสกุลมารดา",
})
motherLastName: string;
@Column({
nullable: true,
default: null,
comment: "อาชีพบิดา",
})
motherCareer: string;
@Column({
nullable: true,
default: null,
comment: "เลขที่บัตรประชาชนมารดา",
})
motherCitizenId: string;
@Column({
nullable: true,
default: null,
comment: "มีชีวิตมารดา",
})
motherLive: boolean;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง ProfileFamilyMother",
default: null,
})
profileFamilyMotherId: string;
@ManyToOne(() => ProfileFamilyMother, (v) => v.histories)
@JoinColumn({ name: "profileFamilyMotherId" })
profileFamilyMother: ProfileFamilyMother;
}