From d5e79acb82afe5709298ef870488866d93559b07 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Wed, 13 Mar 2024 10:43:50 +0700 Subject: [PATCH] add entity org part 2 --- src/entities/Profile.ts | 12 + src/entities/ProfileDiscipline.ts | 52 ++- src/entities/ProfileDisciplineHistory.ts | 72 ++++ src/entities/ProfileDutyHistory.ts | 104 ++++++ src/entities/ProfileDutys.ts | 104 ++++++ src/entities/ProfileNopaid.ts | 94 +++++ src/entities/ProfileNopaidHistory.ts | 94 +++++ src/entities/ProfileOther.ts | 60 +++ src/entities/ProfileOtherHistory.ts | 56 +++ src/entities/ProfileSalary.ts | 348 ++++++++++++++++++ src/entities/ProfileSalaryHistory.ts | 447 +++++++++++++++++++++++ 11 files changed, 1442 insertions(+), 1 deletion(-) create mode 100644 src/entities/ProfileDisciplineHistory.ts create mode 100644 src/entities/ProfileDutyHistory.ts create mode 100644 src/entities/ProfileDutys.ts create mode 100644 src/entities/ProfileNopaid.ts create mode 100644 src/entities/ProfileNopaidHistory.ts create mode 100644 src/entities/ProfileOther.ts create mode 100644 src/entities/ProfileOtherHistory.ts create mode 100644 src/entities/ProfileSalaryHistory.ts diff --git a/src/entities/Profile.ts b/src/entities/Profile.ts index 4d9c583d..4962137f 100644 --- a/src/entities/Profile.ts +++ b/src/entities/Profile.ts @@ -13,6 +13,9 @@ import { ProfileHonor } from "./ProfileHonor"; import { ProfileAssessment } from "./ProfileAssessment"; import { ProfileLeave } from "./ProfileLeave"; import { ProfileAbility } from "./ProfileAbility"; +import { ProfileDuty } from "./ProfileDutys"; +import { ProfileNopaid } from "./ProfileNopaid"; +import { ProfileOther } from "./ProfileOther"; @Entity("profile") export class Profile extends EntityBase { @@ -169,6 +172,15 @@ export class Profile extends EntityBase { @OneToMany(() => ProfileAbility, (profileAbility) => profileAbility.profile) profileAbilities: ProfileAbility[]; + @OneToMany(() => ProfileDuty, (profileDuty) => profileDuty.profile) + profileDutys: ProfileDuty[]; + + @OneToMany(() => ProfileNopaid, (profileNopaid) => profileNopaid.profile) + profileNopaids: ProfileNopaid[]; + + @OneToMany(() => ProfileOther, (profileOther) => profileOther.profile) + profileOthers: ProfileOther[]; + @ManyToOne(() => PosLevel, (posLevel) => posLevel.posLevels) @JoinColumn({ name: "posLevelId" }) posLevel: PosLevel; diff --git a/src/entities/ProfileDiscipline.ts b/src/entities/ProfileDiscipline.ts index 810d9cfe..2272730a 100644 --- a/src/entities/ProfileDiscipline.ts +++ b/src/entities/ProfileDiscipline.ts @@ -1,6 +1,7 @@ -import { Entity, Column, ManyToOne, JoinColumn } from "typeorm"; +import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm"; import { EntityBase } from "./base/Base"; import { Profile } from "./Profile"; +import { ProfileDisciplineHistory } from "./ProfileDisciplineHistory"; @Entity("profileDiscipline") export class ProfileDiscipline extends EntityBase { @@ -19,6 +20,55 @@ export class ProfileDiscipline extends EntityBase { }) profileId: string; + @Column({ + comment: "สถานะการใช้งาน", + default: false, + }) + isActive: boolean; + + @Column({ + nullable: true, + comment: "ระดับความผิด", + type: "text", + default: null, + }) + level: string; + + @Column({ + nullable: true, + comment: "รายละเอียด", + type: "text", + default: null, + }) + detail: string; + + @Column({ + nullable: true, + type: "datetime", + comment: "เอกสารอ้างอิง (ลงวันที่)", + default: null, + }) + refCommandDate: Date; + + @Column({ + nullable: true, + comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)", + type: "text", + default: null, + }) + refCommandNo: string; + + @Column({ + nullable: true, + comment: "ล้างมลทิน", + type: "text", + default: null, + }) + unStigma: string; + + @OneToMany(() => ProfileDisciplineHistory, (profileDisciplineHistory) => profileDisciplineHistory.histories) + profileDisciplineHistories: ProfileDisciplineHistory[]; + @ManyToOne(() => Profile, (profile) => profile.profileDiscipline) @JoinColumn({ name: "profileId" }) profile: Profile; diff --git a/src/entities/ProfileDisciplineHistory.ts b/src/entities/ProfileDisciplineHistory.ts new file mode 100644 index 00000000..62d9131c --- /dev/null +++ b/src/entities/ProfileDisciplineHistory.ts @@ -0,0 +1,72 @@ +import { Entity, Column, ManyToOne, JoinColumn } from "typeorm"; +import { EntityBase } from "./base/Base"; +import { Profile } from "./Profile"; +import { ProfileDiscipline } from "./ProfileDiscipline"; + +@Entity("profileDisciplineHistory") +export class ProfileDisciplineHistory extends EntityBase { + @Column({ + nullable: true, + type: "datetime", + comment: "วันที่", + default: null, + }) + date: Date; + + @Column({ + length: 40, + comment: "ล้างมลทิน", + type: "uuid", + }) + profileDisciplineId: string; + + @Column({ + comment: "สถานะการใช้งาน", + default: false, + }) + isActive: boolean; + + @Column({ + nullable: true, + comment: "ระดับความผิด", + type: "text", + default: null, + }) + level: string; + + @Column({ + nullable: true, + comment: "รายละเอียด", + type: "text", + default: null, + }) + detail: string; + + @Column({ + nullable: true, + type: "datetime", + comment: "เอกสารอ้างอิง (ลงวันที่)", + default: null, + }) + refCommandDate: Date; + + @Column({ + nullable: true, + comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)", + type: "text", + default: null, + }) + refCommandNo: string; + + @Column({ + nullable: true, + comment: "ล้างมลทิน", + type: "text", + default: null, + }) + unStigma: string; + + @ManyToOne(() => ProfileDiscipline, (profileDiscipline) => profileDiscipline.profileDisciplineHistories) + @JoinColumn({ name: "profileDisciplineId" }) + histories: ProfileDiscipline; +} diff --git a/src/entities/ProfileDutyHistory.ts b/src/entities/ProfileDutyHistory.ts new file mode 100644 index 00000000..f9f41395 --- /dev/null +++ b/src/entities/ProfileDutyHistory.ts @@ -0,0 +1,104 @@ +import { Entity, Column, ManyToOne, JoinColumn } from "typeorm"; +import { EntityBase } from "./base/Base"; +import { Profile } from "./Profile"; +import { ProfileDuty } from "./ProfileDutys"; + +@Entity("profileDutyHistory") +export class ProfileDutyHistory extends EntityBase { + + @Column({ + comment: "สถานะการใช้งาน", + default: false, + }) + isActive: boolean; + + @Column({ + nullable: true, + type: "datetime", + comment: "เริ่มต้น", + default: null, + }) + dateStart: Date; + + @Column({ + nullable: true, + type: "datetime", + comment: "สิ้นสุด", + default: null, + }) + dateEnd: Date; + + @Column({ + nullable: true, + comment: "รายละเอียด", + type: "text", + default: null, + }) + detail: string; + + @Column({ + nullable: true, + comment: "เอกสารอ้างอิง", + type: "text", + default: null, + }) + reference: string; + + @Column({ + nullable: true, + type: "datetime", + comment: "เอกสารอ้างอิง (ลงวันที่)", + default: null, + }) + refCommandDate: Date; + + @Column({ + nullable: true, + comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)", + type: "text", + default: null, + }) + refCommandNo: string; + + @Column({ + nullable: true, + length: 40, + comment: "คีย์นอก(FK)ของตาราง ProfileDuty", + default: null, + }) + profileDutyId: string; + + + @ManyToOne(() => ProfileDuty, (profileDuty) => profileDuty.profileDutyHistories) + @JoinColumn({ name: "profileDutyId" }) + histories: ProfileDuty; +} + +export class CreateProfileDutyHistory { + + @Column() + isActive: boolean; + + @Column() + dateStart: Date | null; + + @Column() + dateEnd: Date | null; + + @Column() + detail: string | null; + + @Column() + reference: string | null; + + @Column() + refCommandDate: Date | null; + + @Column() + refCommandNo: string | null; + + @Column("uuid") + profileDutyId: string | null; +} + +export type UpdateProfileDutyHistory = Partial; diff --git a/src/entities/ProfileDutys.ts b/src/entities/ProfileDutys.ts new file mode 100644 index 00000000..fcb869f3 --- /dev/null +++ b/src/entities/ProfileDutys.ts @@ -0,0 +1,104 @@ +import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm"; +import { EntityBase } from "./base/Base"; +import { Profile } from "./Profile"; +import { ProfileDutyHistory } from "./ProfileDutyHistory"; + +@Entity("profileDuty") +export class ProfileDuty extends EntityBase { + @Column({ + nullable: true, + length: 40, + comment: "คีย์นอก(FK)ของตาราง Profile", + default: null, + }) + profileId: string; + + @Column({ + comment: "สถานะการใช้งาน", + default: false, + }) + isActive: boolean; + + @Column({ + nullable: true, + type: "datetime", + comment: "เริ่มต้น", + default: null, + }) + dateStart: Date; + + @Column({ + nullable: true, + type: "datetime", + comment: "สิ้นสุด", + default: null, + }) + dateEnd: Date; + + @Column({ + nullable: true, + comment: "รายละเอียด", + type: "text", + default: null, + }) + detail: string; + + @Column({ + nullable: true, + comment: "เอกสารอ้างอิง", + type: "text", + default: null, + }) + reference: string; + + @Column({ + nullable: true, + type: "datetime", + comment: "เอกสารอ้างอิง (ลงวันที่)", + default: null, + }) + refCommandDate: Date; + + @Column({ + nullable: true, + comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)", + type: "text", + default: null, + }) + refCommandNo: string; + + @OneToMany(() => ProfileDutyHistory, (profileDutyHistory) => profileDutyHistory.histories) + profileDutyHistories: ProfileDutyHistory[]; + + @ManyToOne(() => Profile, (profile) => profile.profileDutys) + @JoinColumn({ name: "profileId" }) + profile: Profile; +} + +export class CreateProfileDuty { + @Column("uuid") + profileId: string | null; + + @Column() + isActive: boolean; + + @Column() + dateStart: Date | null; + + @Column() + dateEnd: Date | null; + + @Column() + detail: string | null; + + @Column() + reference: string | null; + + @Column() + refCommandDate: Date | null; + + @Column() + refCommandNo: string | null; +} + +export type UpdateProfileDuty = Partial; diff --git a/src/entities/ProfileNopaid.ts b/src/entities/ProfileNopaid.ts new file mode 100644 index 00000000..0b877d3d --- /dev/null +++ b/src/entities/ProfileNopaid.ts @@ -0,0 +1,94 @@ +import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm"; +import { EntityBase } from "./base/Base"; +import { Profile } from "./Profile"; +import { ProfileNopaidHistory } from "./ProfileNopaidHistory"; + +@Entity("profileNopaid") +export class ProfileNopaid extends EntityBase { + @Column({ + nullable: true, + length: 40, + comment: "คีย์นอก(FK)ของตาราง Profile", + default: null, + }) + profileId: string; + + @Column({ + comment: "สถานะการใช้งาน", + default: false, + }) + isActive: boolean; + + @Column({ + nullable: true, + type: "datetime", + comment: "วัน เดือน ปี", + default: null, + }) + date: Date; + + @Column({ + nullable: true, + comment: "รายละเอียด", + type: "text", + default: null, + }) + detail: string; + + @Column({ + nullable: true, + comment: "เอกสารอ้างอิง", + type: "text", + default: null, + }) + reference: string; + + @Column({ + nullable: true, + type: "datetime", + comment: "เอกสารอ้างอิง (ลงวันที่)", + default: null, + }) + refCommandDate: Date; + + @Column({ + nullable: true, + comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)", + type: "text", + default: null, + }) + refCommandNo: string; + + @OneToMany(() => ProfileNopaidHistory, (profileNopaidHistory) => profileNopaidHistory.histories) + profileNopaidHistories: ProfileNopaidHistory[]; + + @ManyToOne(() => Profile, (profile) => profile.profileNopaids) + @JoinColumn({ name: "profileId" }) + profile: Profile; +} + +export class CreateProfileNopaid { + @Column("uuid") + profileId: string | null; + + @Column() + isActive: boolean; + + @Column() + date: Date | null; + + @Column() + detail: string | null; + + @Column() + reference: string | null; + + @Column() + refCommandDate: Date | null; + + @Column() + refCommandNo: string | null; + +} + +export type UpdateProfileNopaid = Partial; diff --git a/src/entities/ProfileNopaidHistory.ts b/src/entities/ProfileNopaidHistory.ts new file mode 100644 index 00000000..efdc8641 --- /dev/null +++ b/src/entities/ProfileNopaidHistory.ts @@ -0,0 +1,94 @@ +import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm"; +import { EntityBase } from "./base/Base"; +import { Profile } from "./Profile"; +import { ProfileNopaid } from "./ProfileNopaid"; + +@Entity("profileNopaidHistory") +export class ProfileNopaidHistory extends EntityBase { + + @Column({ + comment: "สถานะการใช้งาน", + default: false, + }) + isActive: boolean; + + @Column({ + nullable: true, + type: "datetime", + comment: "วัน เดือน ปี", + default: null, + }) + date: Date; + + @Column({ + nullable: true, + comment: "รายละเอียด", + type: "text", + default: null, + }) + detail: string; + + @Column({ + nullable: true, + comment: "เอกสารอ้างอิง", + type: "text", + default: null, + }) + reference: string; + + @Column({ + nullable: true, + type: "datetime", + comment: "เอกสารอ้างอิง (ลงวันที่)", + default: null, + }) + refCommandDate: Date; + + @Column({ + nullable: true, + comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)", + type: "text", + default: null, + }) + refCommandNo: string; + + @Column({ + nullable: true, + length: 40, + comment: "คีย์นอก(FK)ของตาราง ProfileNopaid", + default: null, + }) + profileNopaidId: string; + + + @ManyToOne(() => ProfileNopaid, (profileNopaid) => profileNopaid.profileNopaidHistories) + @JoinColumn({ name: "profileNopaidId" }) + histories: ProfileNopaid; +} + +export class CreateProfileNopaidHistory { + + @Column() + isActive: boolean; + + @Column() + date: Date | null; + + @Column() + detail: string | null; + + @Column() + reference: string | null; + + @Column() + refCommandDate: Date | null; + + @Column() + refCommandNo: string | null; + + @Column("uuid") + profileNopaidId: string | null; + +} + +export type UpdateProfileNopaidHistory = Partial; diff --git a/src/entities/ProfileOther.ts b/src/entities/ProfileOther.ts new file mode 100644 index 00000000..96dee565 --- /dev/null +++ b/src/entities/ProfileOther.ts @@ -0,0 +1,60 @@ +import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm"; +import { EntityBase } from "./base/Base"; +import { Profile } from "./Profile"; +import { ProfileOtherHistory } from "./ProfileOtherHistory"; + +@Entity("profileOther") +export class ProfileOther extends EntityBase { + @Column({ + nullable: true, + length: 40, + comment: "คีย์นอก(FK)ของตาราง Profile", + default: null, + }) + profileId: string; + + @Column({ + comment: "สถานะการใช้งาน", + default: false, + }) + isActive: boolean; + + @Column({ + nullable: true, + comment: "รายละเอียด", + type: "text", + default: null, + }) + detail: string; + + @Column({ + nullable: true, + type: "datetime", + comment: "วันที่", + default: null, + }) + date: Date; + + @OneToMany(() => ProfileOtherHistory, (profileOtherHistory) => profileOtherHistory.histories) + profileOtherHistories: ProfileOtherHistory[]; + + @ManyToOne(() => Profile, (profile) => profile.profileOthers) + @JoinColumn({ name: "profileId" }) + profile: Profile; +} + +export class CreateProfileOther { + @Column("uuid") + profileId: string | null; + + @Column() + isActive: boolean; + + @Column() + detail: string | null; + + @Column() + date: Date | null; +} + +export type UpdateProfileOther = Partial; diff --git a/src/entities/ProfileOtherHistory.ts b/src/entities/ProfileOtherHistory.ts new file mode 100644 index 00000000..c4f7350e --- /dev/null +++ b/src/entities/ProfileOtherHistory.ts @@ -0,0 +1,56 @@ +import { Entity, Column, ManyToOne, JoinColumn } from "typeorm"; +import { EntityBase } from "./base/Base"; +import { ProfileOther } from "./ProfileOther"; + +@Entity("profileOtherHistory") +export class ProfileOtherHistory extends EntityBase { + @Column({ + nullable: true, + length: 40, + comment: "คีย์นอก(FK)ของตาราง Profile", + default: null, + }) + profileId: string; + + @Column({ + comment: "สถานะการใช้งาน", + default: false, + }) + isActive: boolean; + + @Column({ + nullable: true, + comment: "รายละเอียด", + type: "text", + default: null, + }) + detail: string; + + @Column({ + nullable: true, + type: "datetime", + comment: "วันที่", + default: null, + }) + date: Date; + + @ManyToOne(() => ProfileOther, (profileOther) => profileOther.profileOtherHistories) + @JoinColumn({ name: "profileId" }) + histories: ProfileOther; +} + +export class CreateProfileOtherHistory { + @Column("uuid") + profileId: string | null; + + @Column() + isActive: boolean; + + @Column() + detail: string | null; + + @Column() + date: Date | null; +} + +export type UpdateProfileOtherHistory = Partial; diff --git a/src/entities/ProfileSalary.ts b/src/entities/ProfileSalary.ts index dc90ca2d..d50053ab 100644 --- a/src/entities/ProfileSalary.ts +++ b/src/entities/ProfileSalary.ts @@ -1,6 +1,7 @@ import { Entity, Column, OneToMany, OneToOne, JoinColumn, ManyToMany, ManyToOne, Double } from "typeorm"; import { EntityBase } from "./base/Base"; import { Profile } from "./Profile" ; +import { ProfileSalaryHistory } from "./ProfileSalaryHistory"; @Entity("profileSalary") export class ProfileSalary extends EntityBase { @@ -42,6 +43,209 @@ export class ProfileSalary extends EntityBase { }) profileId: string; + @Column({ + comment: "สถานะการใช้งาน", + default: false, + }) + isActive: boolean; + + @Column({ + nullable: true, + comment: "ตำแหน่ง (รายละเอียด)", + type: "text", + default: null, + }) + salaryClass: string; + + @Column({ + nullable: true, + comment: "เอกสารอ้างอิง", + type: "text", + default: null, + }) + salaryRef: string; + + @Column({ + nullable: true, + length: 40, + comment: "Id เลขที่ตำแหน่ง", + type: "uuid", + default: null, + }) + posNoId: string; + + @Column({ + nullable: true, + length: 40, + comment: "Id เลขที่ตำแหน่ง", + type: "uuid", + default: null, + }) + positionId: string; + + @Column({ + nullable: true, + length: 40, + comment: "Id สังกัด", + type: "uuid", + default: null, + }) + ocId: string; + + @Column({ + nullable: true, + length: 40, + comment: "Id ตำแหน่งทางการบริหาร", + type: "uuid", + default: null, + }) + positionExecutiveId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id ด้านทางการบริหาร", + type: "uuid", + default: null, + }) + positionExecutiveSideId : string; + + @Column({ + nullable: true, + length: 40, + comment: "", + type: "uuid", + default: null, + }) + positionLevelId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id สายงาน", + type: "uuid", + default: null, + }) + positionLineId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id ด้าน/สาขา", + type: "uuid", + default: null, + }) + positionPathSideId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id ประเภทตำแหน่ง", + type: "uuid", + default: null, + }) + positionTypeId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id ชื่อย่อหน่วยงาน", + type: "uuid", + default: null, + }) + organizationShortNameId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id กลุ่มงาน", + type: "uuid", + default: null, + }) + positionEmployeeGroupId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id ระดับชั้นงาน", + type: "uuid", + default: null, + }) + positionEmployeeLevelId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id ตำแหน่ง", + type: "uuid", + default: null, + }) + positionEmployeePositionId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id ด้านของตำแหน่ง", + type: "uuid", + default: null, + }) + positionEmployeePositionSideId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id เลขที่ตำแหน่งลูกจ้าง", + type: "text", + default: null, + }) + posNoEmployee : string; + + @Column({ + nullable: true, + type: "datetime", + comment: "เอกสารอ้างอิง (ลงวันที่)", + default: null, + }) + refCommandDate: Date; + + @Column({ + nullable: true, + comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)", + type: "text", + default: null, + }) + refCommandNo: string; + + @Column({ + nullable: true, + comment: "ลำดับ", + default: null, + }) + order: number; + + @Column({ + comment: "เลขที่คำสั่ง", + type: "text", + }) + commandNo: string; + + @Column({ + comment: "ประเภทคำสั่ง", + type: "text", + }) + commandTypeName: string; + + @Column({ + nullable: true, + comment: "ประเภทตำแหน่งกรณีพิเศษ", + type: "text", + default: null, + }) + salaryStatus: string; + + @OneToMany(() => ProfileSalaryHistory, (profileSalaryHistory) => profileSalaryHistory.histories) + profileSalaryHistories: ProfileSalaryHistory[]; + @ManyToOne(() => Profile, (profile) => profile.profileSalary) @JoinColumn({ name: "profileId" }) profile: Profile; @@ -75,6 +279,78 @@ export class CreateProfileSalary { }) profileId: string; + // @Column() + // isActive: boolean; + + // @Column() + // salaryClass: string | null; + + // @Column() + // salaryRef: string | null; + + // @Column("uuid") + // posNoId: string | null; + + // @Column("uuid") + // positionId: string | null; + + // @Column("uuid") + // ocId: string | null; + + // @Column("uuid") + // positionExecutiveId : string | null; + + // @Column("uuid") + // positionExecutiveSideId : string | null; + + // @Column("uuid") + // positionLevelId : string | null; + + // @Column("uuid") + // positionLineId : string | null; + + // @Column("uuid") + // positionPathSideId : string | null; + + // @Column("uuid") + // positionTypeId : string | null; + + // @Column("uuid") + // organizationShortNameId : string | null; + + // @Column("uuid") + // positionEmployeeGroupId : string | null; + + // @Column("uuid") + // positionEmployeeLevelId : string | null; + + // @Column("uuid") + // positionEmployeePositionId : string | null; + + // @Column("uuid") + // positionEmployeePositionSideId : string | null; + + // @Column() + // posNoEmployee : string | null; + + // @Column() + // refCommandDate: Date | null; + + // @Column() + // refCommandNo: string | null; + + // @Column() + // order: number | null; + + // @Column() + // commandNo: string; + + // @Column() + // commandTypeName: string; + + // @Column() + // salaryStatus: string | null; + } export class UpdateProfileSalary { @@ -99,5 +375,77 @@ export class UpdateProfileSalary { }) mouthSalaryAmount: Double; + // @Column() + // isActive: boolean; + + // @Column() + // salaryClass: string | null; + + // @Column() + // salaryRef: string | null; + + // @Column("uuid") + // posNoId: string | null; + + // @Column("uuid") + // positionId: string | null; + + // @Column("uuid") + // ocId: string | null; + + // @Column("uuid") + // positionExecutiveId : string | null; + + // @Column("uuid") + // positionExecutiveSideId : string | null; + + // @Column("uuid") + // positionLevelId : string | null; + + // @Column("uuid") + // positionLineId : string | null; + + // @Column("uuid") + // positionPathSideId : string | null; + + // @Column("uuid") + // positionTypeId : string | null; + + // @Column("uuid") + // organizationShortNameId : string | null; + + // @Column("uuid") + // positionEmployeeGroupId : string | null; + + // @Column("uuid") + // positionEmployeeLevelId : string | null; + + // @Column("uuid") + // positionEmployeePositionId : string | null; + + // @Column("uuid") + // positionEmployeePositionSideId : string | null; + + // @Column() + // posNoEmployee : string | null; + + // @Column() + // refCommandDate: Date | null; + + // @Column() + // refCommandNo: string | null; + + // @Column() + // order: number | null; + + // @Column() + // commandNo: string; + + // @Column() + // commandTypeName: string; + + // @Column() + // salaryStatus: string | null; + } diff --git a/src/entities/ProfileSalaryHistory.ts b/src/entities/ProfileSalaryHistory.ts new file mode 100644 index 00000000..8aa2d0d4 --- /dev/null +++ b/src/entities/ProfileSalaryHistory.ts @@ -0,0 +1,447 @@ +import { Entity, Column, OneToMany, OneToOne, JoinColumn, ManyToMany, ManyToOne, Double } from "typeorm"; +import { EntityBase } from "./base/Base"; +import { Profile } from "./Profile" ; +import { ProfileSalary } from "./ProfileSalary"; + +@Entity("profileSalaryHistory") +export class ProfileSalaryHistory extends EntityBase { + @Column({ + comment: "วันที่", + type: "datetime", + nullable: true, + }) + date: Date; + + @Column({ + comment: "เงินเดือนฐาน", + default: 0, + nullable: true, + type: "double" + }) + amount: Double; + + @Column({ + comment: "เงินประจำตำแหน่ง", + default: 0, + nullable: true, + type: "double" + }) + positionSalaryAmount: Double; + + @Column({ + comment: "เงินค่าตอบแทนรายเดือน", + default: 0, + nullable: true, + type: "double" + }) + mouthSalaryAmount: Double; + + @Column({ + length: 40, + comment: "คีย์นอก(FK)ของตาราง profile", + type: "uuid" + }) + profileId: string; + + @Column({ + comment: "สถานะการใช้งาน", + default: false, + }) + isActive: boolean; + + @Column({ + nullable: true, + comment: "ตำแหน่ง (รายละเอียด)", + type: "text", + default: null, + }) + salaryClass: string; + + @Column({ + nullable: true, + comment: "เอกสารอ้างอิง", + type: "text", + default: null, + }) + salaryRef: string; + + @Column({ + nullable: true, + length: 40, + comment: "Id เลขที่ตำแหน่ง", + type: "uuid", + default: null, + }) + posNoId: string; + + @Column({ + nullable: true, + length: 40, + comment: "Id เลขที่ตำแหน่ง", + type: "uuid", + default: null, + }) + positionId: string; + + @Column({ + nullable: true, + length: 40, + comment: "Id สังกัด", + type: "uuid", + default: null, + }) + ocId: string; + + @Column({ + nullable: true, + length: 40, + comment: "Id ตำแหน่งทางการบริหาร", + type: "uuid", + default: null, + }) + positionExecutiveId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id ด้านทางการบริหาร", + type: "uuid", + default: null, + }) + positionExecutiveSideId : string; + + @Column({ + nullable: true, + length: 40, + comment: "", + type: "uuid", + default: null, + }) + positionLevelId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id สายงาน", + type: "uuid", + default: null, + }) + positionLineId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id ด้าน/สาขา", + type: "uuid", + default: null, + }) + positionPathSideId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id ประเภทตำแหน่ง", + type: "uuid", + default: null, + }) + positionTypeId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id ชื่อย่อหน่วยงาน", + type: "uuid", + default: null, + }) + organizationShortNameId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id กลุ่มงาน", + type: "uuid", + default: null, + }) + positionEmployeeGroupId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id ระดับชั้นงาน", + type: "uuid", + default: null, + }) + positionEmployeeLevelId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id ตำแหน่ง", + type: "uuid", + default: null, + }) + positionEmployeePositionId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id ด้านของตำแหน่ง", + type: "uuid", + default: null, + }) + positionEmployeePositionSideId : string; + + @Column({ + nullable: true, + length: 40, + comment: "Id เลขที่ตำแหน่งลูกจ้าง", + type: "text", + default: null, + }) + posNoEmployee : string; + + @Column({ + nullable: true, + type: "datetime", + comment: "เอกสารอ้างอิง (ลงวันที่)", + default: null, + }) + refCommandDate: Date; + + @Column({ + nullable: true, + comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)", + type: "text", + default: null, + }) + refCommandNo: string; + + @Column({ + nullable: true, + comment: "ลำดับ", + default: null, + }) + order: number; + + @Column({ + comment: "เลขที่คำสั่ง", + type: "text", + }) + commandNo: string; + + @Column({ + comment: "ประเภทคำสั่ง", + type: "text", + }) + commandTypeName: string; + + @Column({ + nullable: true, + comment: "ประเภทตำแหน่งกรณีพิเศษ", + type: "text", + default: null, + }) + salaryStatus: string; + + @ManyToOne(() => ProfileSalary, (profileSalary) => profileSalary.profileSalaryHistories) + @JoinColumn({ name: "profileSalaryId" }) + histories: ProfileSalary; +} + +export class CreateProfileSalaryHistory { + + @Column({ + type: "datetime" + }) + date: Date; + + @Column({ + type: "double" + }) + amount: Double; + + @Column({ + type: "double" + }) + positionSalaryAmount: Double; + + @Column({ + type: "double" + }) + mouthSalaryAmount: Double; + + @Column({ + type: "uuid" + }) + profileId: string; + + // @Column() + // isActive: boolean; + + // @Column() + // salaryClass: string | null; + + // @Column() + // salaryRef: string | null; + + // @Column("uuid") + // posNoId: string | null; + + // @Column("uuid") + // positionId: string | null; + + // @Column("uuid") + // ocId: string | null; + + // @Column("uuid") + // positionExecutiveId : string | null; + + // @Column("uuid") + // positionExecutiveSideId : string | null; + + // @Column("uuid") + // positionLevelId : string | null; + + // @Column("uuid") + // positionLineId : string | null; + + // @Column("uuid") + // positionPathSideId : string | null; + + // @Column("uuid") + // positionTypeId : string | null; + + // @Column("uuid") + // organizationShortNameId : string | null; + + // @Column("uuid") + // positionEmployeeGroupId : string | null; + + // @Column("uuid") + // positionEmployeeLevelId : string | null; + + // @Column("uuid") + // positionEmployeePositionId : string | null; + + // @Column("uuid") + // positionEmployeePositionSideId : string | null; + + // @Column() + // posNoEmployee : string | null; + + // @Column() + // refCommandDate: Date | null; + + // @Column() + // refCommandNo: string | null; + + // @Column() + // order: number | null; + + // @Column() + // commandNo: string; + + // @Column() + // commandTypeName: string; + + // @Column() + // salaryStatus: string | null; + +} + +export class UpdateProfileSalaryHistory { + + @Column({ + type: "datetime" + }) + date: Date; + + @Column({ + type: "double" + }) + amount: Double; + + @Column({ + type: "double" + }) + positionSalaryAmount: Double; + + @Column({ + type: "double" + }) + mouthSalaryAmount: Double; + + // @Column() + // isActive: boolean; + + // @Column() + // salaryClass: string | null; + + // @Column() + // salaryRef: string | null; + + // @Column("uuid") + // posNoId: string | null; + + // @Column("uuid") + // positionId: string | null; + + // @Column("uuid") + // ocId: string | null; + + // @Column("uuid") + // positionExecutiveId : string | null; + + // @Column("uuid") + // positionExecutiveSideId : string | null; + + // @Column("uuid") + // positionLevelId : string | null; + + // @Column("uuid") + // positionLineId : string | null; + + // @Column("uuid") + // positionPathSideId : string | null; + + // @Column("uuid") + // positionTypeId : string | null; + + // @Column("uuid") + // organizationShortNameId : string | null; + + // @Column("uuid") + // positionEmployeeGroupId : string | null; + + // @Column("uuid") + // positionEmployeeLevelId : string | null; + + // @Column("uuid") + // positionEmployeePositionId : string | null; + + // @Column("uuid") + // positionEmployeePositionSideId : string | null; + + // @Column() + // posNoEmployee : string | null; + + // @Column() + // refCommandDate: Date | null; + + // @Column() + // refCommandNo: string | null; + + // @Column() + // order: number | null; + + // @Column() + // commandNo: string; + + // @Column() + // commandTypeName: string; + + // @Column() + // salaryStatus: string | null; + +} +