hrms-api-org/src/entities/ProfileSalary.ts

450 lines
11 KiB
TypeScript
Raw Normal View History

2024-10-01 23:33:45 +07:00
import { Entity, Column, OneToMany, JoinColumn, ManyToOne, Double } from "typeorm";
2024-02-23 14:19:39 +07:00
import { EntityBase } from "./base/Base";
2024-03-13 10:52:28 +07:00
import { Profile } from "./Profile";
import { ProfileEmployee } from "./ProfileEmployee";
2024-03-13 10:43:50 +07:00
import { ProfileSalaryHistory } from "./ProfileSalaryHistory";
import { Command } from "./Command";
import { ProfileSalaryTemp } from "./ProfileSalaryTemp";
2024-02-23 14:19:39 +07:00
@Entity("profileSalary")
export class ProfileSalary extends EntityBase {
@Column({
2024-05-16 14:10:08 +07:00
nullable: true,
2024-02-23 14:19:39 +07:00
length: 40,
2024-03-08 14:18:46 +07:00
comment: "คีย์นอก(FK)ของตาราง profile",
2024-03-13 10:52:28 +07:00
type: "uuid",
2024-05-16 14:10:08 +07:00
default: null,
2024-02-23 14:19:39 +07:00
})
profileId: string;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง ProfileEmployee",
default: null,
})
profileEmployeeId: string;
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
comment: "เรียงลำดับใหมาตามการนำเข้า",
default: null,
2024-03-13 10:43:50 +07:00
})
order: number;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
comment: "เลขที่คำสั่ง",
2024-03-13 10:43:50 +07:00
default: null,
})
2025-02-24 17:17:21 +07:00
commandNo: string;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
comment: "ปีที่ออกคำสั่ง",
2024-03-13 10:43:50 +07:00
default: null,
})
commandYear: number;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
@Column({
comment: "คำสั่งวันที่",
type: "datetime",
2024-03-13 10:43:50 +07:00
nullable: true,
})
commandDateSign: Date;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
@Column({
comment: "คำสั่งมีผลวันที่",
type: "datetime",
2024-03-13 10:43:50 +07:00
nullable: true,
})
commandDateAffect: Date;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
comment: "รหัสประเภทของคำสั่ง",
2024-03-13 10:43:50 +07:00
default: null,
})
commandCode: string;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
comment: "ชื่อประเภทคำสั่ง",
2024-03-13 10:43:50 +07:00
default: null,
})
commandName: string;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
length: 40,
comment: "ตัวย่อเลขที่ตำแหน่ง",
2024-03-13 10:43:50 +07:00
default: null,
})
posNoAbb: string;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
length: 40,
comment: "เลขที่ตำแหน่ง",
default: null,
2024-03-13 10:43:50 +07:00
})
posNo: string;
2024-03-13 10:43:50 +07:00
2024-12-06 12:39:46 +07:00
@Column({
nullable: true,
length: 255,
comment: "ตำแหน่ง",
default: null,
2024-12-06 12:39:46 +07:00
})
positionName: string;
2024-12-06 12:39:46 +07:00
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
length: 255,
comment: "ประเภทตำแหน่ง",
default: null,
2024-03-13 10:43:50 +07:00
})
positionType: string;
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
length: 255,
comment: "ระดับตำแหน่ง",
default: null,
2024-03-13 10:43:50 +07:00
})
positionLevel: string;
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
comment: "ระดับของเก่าที่ยังไม่เทียบเท่าแบบแท่ง",
default: null,
})
positionCee: string;
2024-07-10 10:43:56 +07:00
2025-01-08 14:15:28 +07:00
@Column({
nullable: true,
comment: "root name",
default: null,
})
orgRoot: string;
@Column({
nullable: true,
comment: "child1 name",
default: null,
})
orgChild1: string;
@Column({
nullable: true,
comment: "child2 name",
default: null,
})
orgChild2: string;
@Column({
nullable: true,
comment: "child3 name",
default: null,
})
orgChild3: string;
@Column({
nullable: true,
comment: "child4 name",
default: null,
})
orgChild4: string;
@Column({
nullable: true,
length: 255,
comment: "ตำแหน่งทางการบริหาร",
2025-01-08 14:15:28 +07:00
default: null,
})
positionExecutive: string;
2025-01-08 14:15:28 +07:00
@Column({
comment: "เงินเดือนฐาน",
default: 0,
2025-01-08 14:15:28 +07:00
nullable: true,
type: "double",
2025-01-08 14:15:28 +07:00
})
amount: Double;
2025-01-08 14:15:28 +07:00
2024-03-13 10:43:50 +07:00
@Column({
comment: "เงินพิเศษ",
default: 0,
2024-03-13 10:43:50 +07:00
nullable: true,
type: "double",
2024-03-13 10:43:50 +07:00
})
amountSpecial: Double;
2024-03-13 10:43:50 +07:00
2025-01-08 14:15:28 +07:00
@Column({
comment: "เงินประจำตำแหน่ง",
default: 0,
2025-01-08 14:15:28 +07:00
nullable: true,
type: "double",
2025-01-08 14:15:28 +07:00
})
positionSalaryAmount: Double;
2025-01-08 14:15:28 +07:00
2024-03-13 10:43:50 +07:00
@Column({
comment: "เงินค่าตอบแทนรายเดือน",
default: 0,
2024-03-13 10:43:50 +07:00
nullable: true,
type: "double",
2024-03-13 10:43:50 +07:00
})
mouthSalaryAmount: Double;
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
2025-04-05 19:21:50 +07:00
type: "text",
comment: "หมายเหตุ",
default: null,
})
remark: string;
2025-02-26 15:45:45 +07:00
@Column({
nullable: true,
comment: "refId",
default: null,
})
refId: string;
2025-02-26 15:45:45 +07:00
2024-10-17 19:26:33 +07:00
@Column({
comment: "วันที่",
type: "datetime",
nullable: true,
})
dateGovernment: Date;
@Column({
nullable: true,
comment: "เข้ารับราชการ",
default: null,
})
isGovernment: boolean;
2025-02-26 15:45:45 +07:00
@Column({
comment: "ข้อมูลจาก Entry",
2025-05-27 17:13:02 +07:00
default: false,
2025-02-26 15:45:45 +07:00
})
isEntry: boolean;
2025-03-10 14:35:12 +07:00
@Column({
nullable: true,
length: 255,
comment: "ด้านของตำแหน่ง",
default: null,
})
positionPathSide: string;
@Column({
nullable: true,
length: 255,
comment: "ตำแหน่งในสายงาน",
default: null,
})
positionLine: string;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง command",
default: null,
})
commandId: string;
2025-03-24 17:59:47 +07:00
@Column({
nullable: true,
length: 255,
comment: "หน่วยงานที่ออกคำสั่ง",
default: null,
})
posNumCodeSit: string;
@Column({
nullable: true,
length: 255,
comment: "หน่วยงานที่ออกคำสั่ง(ตัวย่อ)",
default: null,
})
posNumCodeSitAbb: string;
2025-06-16 10:54:17 +07:00
@Column({
nullable: true,
length: 255,
comment: "ด้านทางการบริหาร",
default: null,
})
positionExecutiveField: string;
@Column({
nullable: true,
length: 255,
comment: "ด้าน/สาขา",
default: null,
})
positionArea: string;
@ManyToOne(() => Command, (command) => command.profileSalarys)
@JoinColumn({ name: "commandId" })
command: Command;
2024-03-13 10:43:50 +07:00
@OneToMany(() => ProfileSalaryHistory, (profileSalaryHistory) => profileSalaryHistory.histories)
profileSalaryHistories: ProfileSalaryHistory[];
@OneToMany(() => ProfileSalaryTemp, (profileSalaryTemp) => profileSalaryTemp.profileSalary)
profileSalaryTemps: ProfileSalaryTemp[];
2024-02-23 14:19:39 +07:00
@ManyToOne(() => Profile, (profile) => profile.profileSalary)
@JoinColumn({ name: "profileId" })
profile: Profile;
@ManyToOne(() => ProfileEmployee, (profileEmployee) => profileEmployee.profileSalary)
@JoinColumn({ name: "profileEmployeeId" })
profileEmployee: ProfileEmployee;
2024-02-23 14:19:39 +07:00
}
2024-02-23 15:15:11 +07:00
export class CreateProfileSalary {
2025-02-24 17:31:03 +07:00
profileId: string | null;
commandCode?: string | null;
commandNo?: string | null;
commandYear?: number | null;
commandDateAffect?: Date | null;
commandDateSign?: Date | null;
posNoAbb: string | null;
posNo: string | null;
positionName: string | null;
positionType: string | null;
positionLevel: string | null;
positionLine?: string | null;
positionPathSide?: string | null;
2025-04-01 13:37:32 +07:00
positionExecutive?: string | null;
2025-06-16 10:54:17 +07:00
positionExecutiveField?: string | null;
positionArea?: string | null;
amount?: Double | null;
amountSpecial?: Double | null;
positionSalaryAmount?: Double | null;
mouthSalaryAmount?: Double | null;
2025-03-10 14:35:12 +07:00
orgRoot?: string | null;
orgChild1?: string | null;
orgChild2?: string | null;
orgChild3?: string | null;
orgChild4?: string | null;
remark: string | null;
commandId?: string | null;
isGovernment?: boolean | null;
positionCee?: string | null;
commandName?: string | null;
2025-03-28 13:58:06 +07:00
posNumCodeSit?: string | null;
posNumCodeSitAbb?: string | null;
2024-02-23 15:15:11 +07:00
}
2024-02-23 14:19:39 +07:00
export class CreateProfileSalaryEmployee {
profileEmployeeId: string | null;
commandCode?: string | null;
commandNo?: string | null;
commandYear?: number | null;
commandDateAffect?: Date | null;
commandDateSign?: Date | null;
posNoAbb: string | null;
posNo: string | null;
positionName: string | null;
positionType: string | null;
positionLevel: string | null;
positionLine?: string | null;
positionPathSide?: string | null;
2025-04-01 13:37:32 +07:00
positionExecutive?: string | null;
positionExecutiveField?: string | null;
positionArea?: string | null;
amount?: Double | null;
amountSpecial?: Double | null;
positionSalaryAmount?: Double | null;
mouthSalaryAmount?: Double | null;
2025-03-10 14:35:12 +07:00
orgRoot?: string | null;
orgChild1?: string | null;
orgChild2?: string | null;
orgChild3?: string | null;
orgChild4?: string | null;
remark: string | null;
commandId?: string | null;
isGovernment?: boolean | null;
positionCee?: string | null;
commandName?: string | null;
2025-03-28 13:58:06 +07:00
posNumCodeSit?: string | null;
posNumCodeSitAbb?: string | null;
2025-04-11 11:53:51 +07:00
salaryLevel?: number | null;
2025-04-28 15:01:15 +07:00
group?: number | null;
}
export class UpdateProfileSalaryEmployee {
commandCode?: string | null;
commandNo?: string | null;
commandYear?: number | null;
commandDateAffect?: Date | null;
commandDateSign?: Date | null;
posNoAbb: string | null;
posNo: string | null;
positionName: string | null;
positionType: string | null;
positionLevel: string | null;
positionLine?: string | null;
positionPathSide?: string | null;
2025-04-01 13:37:32 +07:00
positionExecutive?: string | null;
positionExecutiveField?: string | null;
positionArea?: string | null;
amount?: Double | null;
amountSpecial?: Double | null;
positionSalaryAmount?: Double | null;
mouthSalaryAmount?: Double | null;
2025-03-10 14:35:12 +07:00
orgRoot?: string | null;
orgChild1?: string | null;
orgChild2?: string | null;
orgChild3?: string | null;
orgChild4?: string | null;
remark: string | null;
commandId?: string | null;
isGovernment?: boolean | null;
positionCee?: string | null;
commandName?: string | null;
2025-03-28 13:58:06 +07:00
posNumCodeSit?: string | null;
posNumCodeSitAbb?: string | null;
2025-04-11 11:53:51 +07:00
salaryLevel?: number | null;
2025-04-28 15:01:15 +07:00
group?: number | null;
}
export type UpdateProfileSalary = {
commandCode?: string | null;
commandNo?: string | null;
commandYear?: number | null;
commandDateAffect?: Date | null;
commandDateSign?: Date | null;
posNoAbb: string | null;
posNo: string | null;
positionName: string | null;
positionType: string | null;
positionLevel: string | null;
positionLine?: string | null;
positionPathSide?: string | null;
2025-04-01 13:37:32 +07:00
positionExecutive?: string | null;
positionExecutiveField?: string | null;
positionArea?: string | null;
amount?: Double | null;
2024-12-10 09:22:10 +07:00
amountSpecial?: Double | null;
positionSalaryAmount?: Double | null;
mouthSalaryAmount?: Double | null;
2025-03-10 14:35:12 +07:00
orgRoot?: string | null;
orgChild1?: string | null;
orgChild2?: string | null;
orgChild3?: string | null;
orgChild4?: string | null;
remark: string | null;
commandId?: string | null;
isGovernment?: boolean | null;
positionCee?: string | null;
commandName?: string | null;
2025-03-28 13:58:06 +07:00
posNumCodeSit?: string | null;
posNumCodeSitAbb?: string | null;
};