family entity (father, mother, couple)
This commit is contained in:
parent
291d3199d2
commit
968842557a
8 changed files with 575 additions and 0 deletions
112
src/entities/ProfileFamilyFather.ts
Normal file
112
src/entities/ProfileFamilyFather.ts
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
import { Column, Entity, ManyToOne, OneToMany, JoinColumn } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { Profile } from "./Profile";
|
||||
import { ProfileEmployee } from "./ProfileEmployee";
|
||||
import { ProfileFamilyFatherHistory } from "./ProfileFamilyFatherHistory";
|
||||
|
||||
@Entity("profileFamilyFather")
|
||||
export class ProfileFamilyFather 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,
|
||||
type: "uuid",
|
||||
comment: "คีย์นอก(FK) ของตาราง Profile",
|
||||
default: null,
|
||||
})
|
||||
profileId: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง ProfileEmployee",
|
||||
default: null,
|
||||
})
|
||||
profileEmployeeId: string;
|
||||
|
||||
@OneToMany(
|
||||
() => ProfileFamilyFatherHistory,
|
||||
(v) => v.histories,
|
||||
)
|
||||
profileFamilyFather: ProfileFamilyFatherHistory[];
|
||||
|
||||
@ManyToOne(() => Profile, (v) => v.profileFamilyFather)
|
||||
@JoinColumn({ name: "profileId" })
|
||||
profile: Profile;
|
||||
|
||||
@ManyToOne(() => ProfileEmployee, (v) => v.profileFamilyFather)
|
||||
@JoinColumn({ name: "profileEmployeeId" })
|
||||
profileEmployee: ProfileEmployee;
|
||||
|
||||
}
|
||||
|
||||
export type CreateProfileFamilyFather = {
|
||||
profileId: string;
|
||||
fatherPrefix: string | null;
|
||||
fatherFirstName: string | null;
|
||||
fatherLastName: string | null;
|
||||
fatherCareer: string | null;
|
||||
fatherCitizenId: string | null;
|
||||
fatherLive: boolean | null;
|
||||
}
|
||||
|
||||
export type CreateProfileEmployeeFamilyFather = {
|
||||
profileEmployeeId: string;
|
||||
fatherPrefix: string | null;
|
||||
fatherFirstName: string | null;
|
||||
fatherLastName: string | null;
|
||||
fatherCareer: string | null;
|
||||
fatherCitizenId: string | null;
|
||||
fatherLive: boolean | null;
|
||||
}
|
||||
|
||||
export type UpdateProfileFamilyFather = {
|
||||
fatherPrefix?: string | null;
|
||||
fatherFirstName?: string | null;
|
||||
fatherLastName?: string | null;
|
||||
fatherCareer?: string | null;
|
||||
fatherCitizenId?: string | null;
|
||||
fatherLive?: boolean | null;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue