hrms-api-salary/src/entities/SalaryProfile.ts

506 lines
9.2 KiB
TypeScript
Raw Normal View History

2024-02-23 17:17:19 +07:00
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { SalaryOrg } from "./SalaryOrg";
2024-02-23 17:17:19 +07:00
@Entity("salaryProfile")
export class SalaryProfile extends EntityBase {
@Column({
2024-03-08 14:36:57 +07:00
comment: "คีย์นอก(FK)ของตาราง salaryOrg",
2024-02-23 17:17:19 +07:00
length: 40,
})
salaryOrgId: string;
@Column({
nullable: true,
length: 40,
comment: "ไอดีโปรไฟล์",
default: null,
})
profileId: string;
2024-05-28 15:29:05 +07:00
@Column({
nullable: true,
comment: "ยศ",
length: 255,
default: null,
})
rank: string;
2024-02-23 17:17:19 +07:00
@Column({
nullable: true,
comment: "คำนำหน้า",
length: 255,
default: null,
})
prefix: string;
@Column({
nullable: true,
comment: "ชื่อ",
length: 255,
default: null,
})
firstName: string;
@Column({
nullable: true,
comment: "สกุล",
length: 255,
default: null,
})
lastName: string;
@Column({
nullable: true,
comment: "เลขบัตรประชาชน",
length: 100,
default: null,
})
citizenId: string;
@Column({
nullable: true,
comment: "Prefix นำหน้าเลขที่ตำแหน่ง เป็น Optional (ไม่ใช่อักษรย่อของหน่วยงาน/ส่วนราชการ)",
length: 100,
default: null,
})
posMasterNoPrefix: string;
@Column({
2024-02-27 11:05:20 +07:00
nullable: true,
comment: "เลขที่ตำแหน่ง เป็นตัวเลข",
2024-02-27 11:05:20 +07:00
default: null,
})
posMasterNo: number;
@Column({
nullable: true,
comment: "Suffix หลังเลขที่ตำแหน่ง เช่น ช.",
length: 100,
default: null,
})
posMasterNoSuffix: string;
@Column({
nullable: true,
comment: "ชื่อย่อหน่วยงาน",
length: 100,
default: null,
2024-02-23 17:17:19 +07:00
})
orgShortName: string;
2024-02-23 17:17:19 +07:00
@Column({
nullable: true,
comment: "ตำแหน่ง",
length: 255,
default: null,
})
position: string;
@Column({
2024-02-27 11:05:20 +07:00
nullable: true,
2024-02-23 17:17:19 +07:00
comment: "ประเภทตำแหน่ง",
length: 100,
2024-02-27 11:05:20 +07:00
default: null,
2024-02-23 17:17:19 +07:00
})
posType: string;
2024-02-23 17:17:19 +07:00
@Column({
2024-02-27 11:05:20 +07:00
nullable: true,
2024-02-23 17:17:19 +07:00
comment: "ระดับตำแหน่ง",
length: 100,
2024-02-27 11:05:20 +07:00
default: null,
})
posLevel: string;
@Column({
2024-02-27 11:05:20 +07:00
nullable: true,
comment: "ตำแหน่งทางการบริหาร",
length: 255,
2024-02-27 11:05:20 +07:00
default: null,
2024-02-23 17:17:19 +07:00
})
posExecutive: string;
2024-02-23 17:17:19 +07:00
@Column({
2024-02-27 11:05:20 +07:00
nullable: true,
type: "double",
2024-02-23 17:17:19 +07:00
comment: "เงินเดือนฐาน",
2024-02-27 11:05:20 +07:00
default: null,
2024-02-23 17:17:19 +07:00
})
amount: number | null;
2024-02-23 17:17:19 +07:00
@Column({
type: "double",
comment: "เงินพิเศษ",
default: 0,
})
amountSpecial: number;
2024-02-23 17:17:19 +07:00
@Column({
type: "double",
2024-02-23 17:17:19 +07:00
comment: "จำนวนเงินที่ใช้เลื่อน",
default: 0,
2024-02-23 17:17:19 +07:00
})
amountUse: number;
2024-02-23 17:17:19 +07:00
@Column({
type: "double",
2024-02-23 17:17:19 +07:00
comment: "เงินเดือนหลังเลื่อน",
default: 0,
2024-02-23 17:17:19 +07:00
})
positionSalaryAmount: number;
2024-02-23 17:17:19 +07:00
@Column({
comment:
"ประเภทการเลื่อน(ขั้น) PENDING->รายชื่อคนครอง NONE->ไม่ได้เลื่อน HAFT->ครึ่งขั้น FULL->1ขั้น FULLHAFT->1.5ขั้น",
length: 20,
2024-02-27 11:05:20 +07:00
default: "PENDING",
2024-02-23 17:17:19 +07:00
})
type: string;
@Column({
comment: "สถานะ",
length: 20,
default: "PENDING",
})
status: string;
2025-03-18 17:31:35 +07:00
@Column({
comment: "สถานะออกคำสั่ง33",
length: 20,
2025-03-18 18:31:05 +07:00
default: "PENDING",
2025-03-18 17:31:35 +07:00
})
status33: string;
@Column({
comment: "สถานะออกคำสั่ง34",
length: 20,
2025-03-18 18:31:05 +07:00
default: "PENDING",
2025-03-18 17:31:35 +07:00
})
status34: string;
@Column({
comment: "สถานะออกคำสั่ง35",
length: 20,
2025-03-18 18:31:05 +07:00
default: "PENDING",
2025-03-18 17:31:35 +07:00
})
status35: string;
@Column({
nullable: true,
comment: "id revision",
length: 40,
})
revisionId: string;
2025-04-05 18:12:02 +07:00
@Column({
nullable: true,
comment: "order orgRoot",
length: 40,
})
rootOrder: string;
2024-02-23 17:17:19 +07:00
@Column({
2024-02-27 11:05:20 +07:00
nullable: true,
2024-03-08 14:36:57 +07:00
comment: "คีย์นอก(FK)ของตาราง orgRoot",
2024-02-23 17:17:19 +07:00
length: 40,
})
rootId: string;
@Column({
nullable: true,
2024-03-08 14:36:57 +07:00
comment: "ชื่อของหน่วยงาน",
2024-02-23 17:17:19 +07:00
length: 255,
default: null,
})
root: string;
2025-04-05 18:12:02 +07:00
@Column({
nullable: true,
comment: "Order orgChild1",
length: 40,
})
child1Order: string;
2024-02-23 17:17:19 +07:00
@Column({
2024-02-27 11:05:20 +07:00
nullable: true,
2024-03-08 14:36:57 +07:00
comment: "คีย์นอก(FK)ของตาราง orgChild1",
2024-02-23 17:17:19 +07:00
length: 40,
})
child1Id: string;
@Column({
nullable: true,
2024-03-08 14:36:57 +07:00
comment: "ชื่อส่วนราชการ",
2024-02-23 17:17:19 +07:00
length: 255,
default: null,
})
child1: string;
2025-04-05 18:12:02 +07:00
@Column({
nullable: true,
comment: "Order orgChild2",
length: 40,
})
child2Order: string;
2024-02-23 17:17:19 +07:00
@Column({
2024-02-27 11:05:20 +07:00
nullable: true,
2024-03-08 14:36:57 +07:00
comment: "คีย์นอก(FK)ของตาราง orgChild2",
2024-02-23 17:17:19 +07:00
length: 40,
})
child2Id: string;
@Column({
nullable: true,
2024-03-08 14:36:57 +07:00
comment: "ชื่อส่วนราชการ",
2024-02-23 17:17:19 +07:00
length: 255,
default: null,
})
child2: string;
2025-04-05 18:12:02 +07:00
@Column({
nullable: true,
comment: "Order orgChild3",
length: 40,
})
child3Order: string;
2024-02-23 17:17:19 +07:00
@Column({
2024-02-27 11:05:20 +07:00
nullable: true,
2024-03-08 14:36:57 +07:00
comment: "คีย์นอก(FK)ของตาราง orgChild3",
2024-02-23 17:17:19 +07:00
length: 40,
})
child3Id: string;
@Column({
nullable: true,
2024-03-08 14:36:57 +07:00
comment: "ชื่อส่วนราชการ",
2024-02-23 17:17:19 +07:00
length: 255,
default: null,
})
child3: string;
2025-04-05 18:12:02 +07:00
@Column({
nullable: true,
comment: "Order orgChild4",
length: 40,
})
child4Order: string;
2024-02-23 17:17:19 +07:00
@Column({
2024-02-27 11:05:20 +07:00
nullable: true,
2024-03-08 14:36:57 +07:00
comment: "คีย์นอก(FK)ของตาราง orgChild4",
2024-02-23 17:17:19 +07:00
length: 40,
})
child4Id: string;
@Column({
nullable: true,
2024-03-08 14:36:57 +07:00
comment: "ชื่อส่วนราชการ",
2024-02-23 17:17:19 +07:00
length: 255,
default: null,
})
child4: string;
2024-02-27 12:56:44 +07:00
@Column({
nullable: true,
default: null,
2024-07-05 11:25:35 +07:00
length: 255,
comment: "ผลการประเมินผลการปฏิบัติราชการ", //คะแนนประเมิน
2024-02-27 12:56:44 +07:00
})
2024-07-05 11:25:35 +07:00
result: string;
2024-02-27 12:56:44 +07:00
@Column({
nullable: true,
default: null,
type: "text",
comment: "หมายเหตุ",
})
remark: string;
2024-02-27 12:56:44 +07:00
@Column({
nullable: true,
comment: "ระยะเวลาการปฏิบัติราชการในรอบครึ่งปี",
default: null,
2024-02-27 12:56:44 +07:00
})
duration: string;
2024-02-27 12:56:44 +07:00
@Column({
nullable: true,
comment: "การลงโทษทางวินัย",
2024-03-07 16:17:33 +07:00
default: null,
2024-02-27 12:56:44 +07:00
})
isPunish: boolean;
2024-02-27 12:56:44 +07:00
@Column({
nullable: true,
2024-02-27 12:56:44 +07:00
comment: "พักราชการ",
2024-03-07 16:17:33 +07:00
default: null,
2024-02-27 12:56:44 +07:00
})
isSuspension: boolean;
2024-02-27 12:56:44 +07:00
@Column({
nullable: true,
2024-02-27 12:56:44 +07:00
comment: "ขาดราชการ",
2024-03-07 16:17:33 +07:00
default: null,
})
isAbsent: boolean;
@Column({
nullable: true,
comment: "วันลา",
2024-03-07 16:17:33 +07:00
default: null,
2024-02-27 12:56:44 +07:00
})
isLeave: boolean;
2024-02-27 12:56:44 +07:00
2024-02-29 11:29:05 +07:00
@Column({
nullable: true,
comment: "เกษียญ",
default: false,
})
isRetired: boolean;
@Column({
nullable: true,
comment: "สำรอง",
default: false,
})
isReserve: boolean;
2024-03-07 17:37:00 +07:00
@Column({
nullable: true,
comment: "ทะลุขั้น",
default: false,
})
isNext: boolean;
@Column({
nullable: true,
comment: "ฉ",
default: null,
})
isSpecial: boolean;
2025-05-13 16:08:01 +07:00
@Column({
nullable: true,
comment: "ดีเด่น",
default: null,
})
isGood: boolean;
@ManyToOne(() => SalaryOrg, (salaryOrg) => salaryOrg.salaryProfiles)
@JoinColumn({ name: "salaryOrgId" })
salaryOrg: SalaryOrg;
2024-02-23 17:17:19 +07:00
}
export class CreateSalaryProfile {
@Column("uuid")
id: string;
2024-02-23 17:17:19 +07:00
@Column()
type: string;
2024-02-23 17:17:19 +07:00
@Column()
profileId: string;
2024-05-28 15:29:05 +07:00
@Column()
rank?: string | null;
@Column()
prefix: string;
@Column()
firstName: string;
@Column()
lastName: string;
@Column()
citizenId: string;
@Column()
2024-02-28 16:04:09 +07:00
posMasterNoPrefix: string | null;
@Column()
posMasterNo: number;
@Column()
2024-02-28 16:04:09 +07:00
posMasterNoSuffix: string | null;
@Column()
2024-02-28 16:04:09 +07:00
orgShortName: string | null;
@Column()
position: string;
@Column()
posType: string;
@Column()
posLevel: string;
2024-02-28 13:59:03 +07:00
@Column()
2024-02-28 16:04:09 +07:00
posExecutive: string | null;
2024-02-28 13:59:03 +07:00
@Column()
amount: number | null;
@Column("uuid")
2024-02-28 16:04:09 +07:00
rootId: string | null;
@Column()
2024-02-28 16:04:09 +07:00
root: string | null;
@Column("uuid")
2024-02-28 16:04:09 +07:00
child1Id: string | null;
@Column()
2024-02-28 16:04:09 +07:00
child1: string | null;
@Column("uuid")
2024-02-28 16:04:09 +07:00
child2Id: string | null;
@Column()
2024-02-28 16:04:09 +07:00
child2: string | null;
2024-02-23 17:17:19 +07:00
@Column("uuid")
2024-02-28 16:04:09 +07:00
child3Id: string | null;
@Column()
2024-02-28 16:04:09 +07:00
child3: string | null;
@Column("uuid")
2024-02-28 16:04:09 +07:00
child4Id: string | null;
@Column()
2024-02-28 16:04:09 +07:00
child4: string | null;
2024-02-28 13:59:03 +07:00
@Column()
result: string | null;
2024-02-28 13:59:03 +07:00
@Column()
duration: string | null;
2024-02-28 13:59:03 +07:00
@Column()
isPunish: boolean;
@Column()
isSuspension: boolean;
2024-02-28 13:59:03 +07:00
@Column()
isAbsent: boolean;
2024-02-29 11:29:05 +07:00
@Column()
isLeave: boolean;
2024-02-28 13:59:03 +07:00
@Column()
2024-02-29 11:29:05 +07:00
isRetired: boolean;
@Column()
isSpecial: boolean;
2024-07-08 17:46:32 +07:00
2024-07-16 16:31:14 +07:00
// @Column()
// remark: string | null;
}