diff --git a/src/entities/Profile.ts b/src/entities/Profile.ts index b70a71b7..55a300f5 100644 --- a/src/entities/Profile.ts +++ b/src/entities/Profile.ts @@ -18,6 +18,7 @@ import { ProfileNopaid } from "./ProfileNopaid"; import { ProfileOther } from "./ProfileOther"; import { ProfileInformation } from "./ProfileInformation"; import { ProfileFamilyHistory } from "./ProfileFamily"; +import { ProfileGovernment } from "./ProfileGovernment"; @Entity("profile") export class Profile extends EntityBase { @@ -186,6 +187,9 @@ export class Profile extends EntityBase { @OneToMany(() => ProfileFamilyHistory, (profileFamily) => profileFamily.profile) profileFamily: ProfileFamilyHistory[]; + @OneToMany(() => ProfileGovernment, (profileGovernment) => profileGovernment.profile) + profileGovernment: ProfileGovernment[]; + @ManyToOne(() => PosLevel, (posLevel) => posLevel.profiles) @JoinColumn({ name: "posLevelId" }) posLevel: PosLevel; diff --git a/src/entities/ProfileGovernment.ts b/src/entities/ProfileGovernment.ts new file mode 100644 index 00000000..1eb81ee3 --- /dev/null +++ b/src/entities/ProfileGovernment.ts @@ -0,0 +1,225 @@ +import { Column, Entity, ManyToOne } from "typeorm"; +import { EntityBase } from "./base/Base"; +import { Profile } from "./Profile"; + +@Entity("profileGovernment") +export class ProfileGovernment extends EntityBase { + @Column({ + comment: "สถานะการใช้งาน", + default: false, + }) + isActive: boolean; + + @Column({ + nullable: true, + length: 40, + comment: "คีย์นอก(FK)ของตาราง Profile", + default: null, + }) + profileId: string; + + @ManyToOne(() => Profile, (v) => v.profileGovernment) + profile: Profile; + + @Column({ + nullable: true, + length: 40, + default: null, + comment: "เลขที่ตำแหน่ง", + }) + posNoId: string; + + @Column({ + nullable: true, + length: 40, + default: null, + comment: "สังกัด", + }) + ocId: string; + + @Column({ + nullable: true, + length: 40, + default: null, + comment: "คีย์นอก(FK)ของตาราง Position", + }) + positionId: string; + + @Column({ + nullable: true, + default: null, + comment: "วันที่สั่งบรรจุ", + }) + dateAppoint: Date; + + @Column({ + nullable: true, + default: null, + comment: "เริ่มปฎิบัติราชการ", + }) + dateStart: Date; + + @Column({ + nullable: true, + default: null, + comment: "วันเกษียณอายุ", + }) + retireDate: Date; + + @Column({ + nullable: true, + default: null, + comment: "อายุราชการ", + }) + govAge: string; + + @Column({ + nullable: true, + default: null, + comment: "ขาดราชการ", + }) + govAgeAbsent: string; + + @Column({ + nullable: true, + default: null, + comment: "อายุราชการเกื้อกูล", + }) + govAgePlus: string; + + @Column({ + nullable: true, + default: null, + comment: "สังกัด", + }) + oc: string; + + @Column({ + nullable: true, + default: null, + comment: "เลขที่ตำแหน่ง", + }) + posNo: string; + + @Column({ + nullable: true, + default: null, + comment: "ตำแหน่ง", + }) + postition: string; + + @Column({ + nullable: true, + default: null, + comment: "ระดับตำแหน่ง", + }) + positionLevel: string; + + @Column({ + nullable: true, + default: null, + comment: "สายงาน", + }) + positionLine: string; + + @Column({ + nullable: true, + default: null, + comment: "ประเภทตำแหน่ง", + }) + positionType: string; + + @Column({ + nullable: true, + default: null, + comment: "ตำแหน่งทางการบริหาร", + }) + positionExecutive: string; + + @Column({ + nullable: true, + default: null, + comment: "เหตุผลกรณีไม่ตรงวัน", + }) + reasonSameDate: string; + + @Column({ + nullable: true, + default: null, + comment: "กลุ่มงาน", + }) + positionEmployeeGroup: string; + + @Column({ + nullable: true, + default: null, + comment: "ระดับชั้นงาน", + }) + positionEmployeeLevel: string; + + @Column({ + nullable: true, + default: null, + comment: "ตำแหน่ง", + }) + positionEmployeePosition: string; + + @Column({ + nullable: true, + default: null, + comment: "ด้านของตำแหน่ง", + }) + positionEmployeePositionSide: string; +} +export type CreateProfileGovernment = { + isActive: boolean | null; + positionId: string | null; + profileId: string | null; + profile: Profile | null; + posNoId: string | null; + ocId: string | null; + dateAppoint: Date | null; + dateStart: Date | null; + retireDate: Date | null; + govAge: string | null; + govAgeAbsent: string | null; + govAgePlus: string | null; + oc: string | null; + posNo: string | null; + postition: string | null; + positionLevel: string | null; + positionLine: string | null; + positionType: string | null; + positionExecutive: string | null; + reasonSameDate: string | null; + positionEmployeeGroup: string | null; + positionEmployeeLevel: string | null; + positionEmployeePosition: string | null; + positionEmployeePositionSide: string | null; +}; + +export type UpdateProfileGovernment = { + isActive?: boolean | null; + positionId?: string | null; + profile?: Profile | null; + posNoId?: string | null; + ocId?: string | null; + dateAppoint?: Date | null; + dateStart?: Date | null; + retireDate?: Date | null; + govAge?: string | null; + govAgeAbsent?: string | null; + govAgePlus?: string | null; + oc?: string | null; + posNo?: string | null; + postition?: string | null; + positionLevel?: string | null; + positionLine?: string | null; + positionType?: string | null; + positionExecutive?: string | null; + reasonSameDate?: string | null; + positionEmployeeGroup?: string | null; + positionEmployeeLevel?: string | null; + positionEmployeePosition?: string | null; + positionEmployeePositionSide?: string | null; +};