แก้ไขบุตร
This commit is contained in:
parent
291d3199d2
commit
0114e41c3a
7 changed files with 511 additions and 106 deletions
112
src/entities/ProfileChildren.ts
Normal file
112
src/entities/ProfileChildren.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 { ProfileChildrenHistory } from "./ProfileChildrenHistory";
|
||||
|
||||
@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, (Profile) => Profile.profileChildrens)
|
||||
@JoinColumn({ name: "profileId" })
|
||||
profile: Profile;
|
||||
|
||||
@ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileChildrens)
|
||||
@JoinColumn({ name: "profileEmployeeId" })
|
||||
profileEmployee: ProfileEmployee;
|
||||
|
||||
@OneToMany(
|
||||
() => ProfileChildrenHistory,
|
||||
(profileChildrenHistory) => profileChildrenHistory.histories,
|
||||
)
|
||||
profileChildrenHistories: ProfileChildrenHistory[];
|
||||
}
|
||||
|
||||
export type CreateProfileChildren = {
|
||||
profileId: string;
|
||||
childrenCareer: string;
|
||||
childrenFirstName: string;
|
||||
childrenLastName: string;
|
||||
childrenPrefix: string;
|
||||
childrenLive: boolean;
|
||||
childrenCitizenId: string;
|
||||
};
|
||||
|
||||
export type CreateProfileChildrenEmployee = {
|
||||
profileEmployeeId: string;
|
||||
childrenCareer: string;
|
||||
childrenFirstName: string;
|
||||
childrenLastName: string;
|
||||
childrenPrefix: string;
|
||||
childrenLive: boolean;
|
||||
childrenCitizenId: string;
|
||||
};
|
||||
|
||||
export type UpdateProfileChildren = {
|
||||
id: string;
|
||||
childrenCareer?: string | null;
|
||||
childrenFirstName?: string | null;
|
||||
childrenLastName?: string | null;
|
||||
childrenPrefix?: string | null;
|
||||
childrenLive?: boolean | null;
|
||||
childrenCitizenId?: string | null;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue