2024-10-07 14:53:27 +07:00
|
|
|
import { Entity, Column, JoinColumn, ManyToOne, Double } from "typeorm";
|
2024-03-13 10:43:50 +07:00
|
|
|
import { EntityBase } from "./base/Base";
|
|
|
|
|
import { ProfileSalary } from "./ProfileSalary";
|
2024-10-18 16:11:22 +07:00
|
|
|
import { Command } from "./Command";
|
2024-03-13 10:43:50 +07:00
|
|
|
|
|
|
|
|
@Entity("profileSalaryHistory")
|
|
|
|
|
export class ProfileSalaryHistory extends EntityBase {
|
2024-05-17 09:41:02 +07:00
|
|
|
// @Column({
|
|
|
|
|
// length: 40,
|
|
|
|
|
// comment: "คีย์นอก(FK)ของตาราง profile",
|
|
|
|
|
// type: "uuid",
|
|
|
|
|
// })
|
|
|
|
|
// profileId: string;
|
2024-03-13 10:43:50 +07:00
|
|
|
|
|
|
|
|
@Column({
|
2024-03-26 23:07:55 +07:00
|
|
|
comment: "วันที่",
|
|
|
|
|
type: "datetime",
|
2024-03-13 10:43:50 +07:00
|
|
|
nullable: true,
|
|
|
|
|
})
|
2024-03-26 23:07:55 +07:00
|
|
|
date: Date;
|
2024-03-13 10:52:28 +07:00
|
|
|
|
2024-03-13 10:43:50 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
length: 40,
|
2024-03-26 23:07:55 +07:00
|
|
|
comment: "เลขที่ตำแหน่ง",
|
2024-03-13 10:43:50 +07:00
|
|
|
default: null,
|
|
|
|
|
})
|
2024-03-26 23:07:55 +07:00
|
|
|
posNo: string;
|
2024-03-13 10:52:28 +07:00
|
|
|
|
2024-03-13 10:43:50 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
2024-03-26 23:07:55 +07:00
|
|
|
length: 255,
|
|
|
|
|
comment: "ตำแหน่ง",
|
2024-03-13 10:43:50 +07:00
|
|
|
default: null,
|
|
|
|
|
})
|
2024-03-26 23:07:55 +07:00
|
|
|
position: string;
|
2024-03-13 10:52:28 +07:00
|
|
|
|
2024-03-13 10:43:50 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
2024-03-26 23:07:55 +07:00
|
|
|
length: 255,
|
|
|
|
|
comment: "สายงาน",
|
2024-03-13 10:43:50 +07:00
|
|
|
default: null,
|
|
|
|
|
})
|
2024-03-26 23:07:55 +07:00
|
|
|
positionLine: string;
|
2024-03-13 10:52:28 +07:00
|
|
|
|
2024-03-13 10:43:50 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
2024-03-26 23:07:55 +07:00
|
|
|
length: 255,
|
|
|
|
|
comment: "ด้าน/สาขา",
|
2024-03-13 10:43:50 +07:00
|
|
|
default: null,
|
|
|
|
|
})
|
2024-03-26 23:07:55 +07:00
|
|
|
positionPathSide: string;
|
2024-03-13 10:52:28 +07:00
|
|
|
|
2024-03-13 10:43:50 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
2024-03-26 23:07:55 +07:00
|
|
|
length: 255,
|
|
|
|
|
comment: "ตำแหน่งทางการบริหาร",
|
2024-03-13 10:43:50 +07:00
|
|
|
default: null,
|
|
|
|
|
})
|
2024-03-26 23:07:55 +07:00
|
|
|
positionExecutive: string;
|
2024-03-13 10:52:28 +07:00
|
|
|
|
2024-03-13 10:43:50 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
2024-03-26 23:07:55 +07:00
|
|
|
length: 255,
|
|
|
|
|
comment: "ประเภทตำแหน่ง",
|
2024-03-13 10:43:50 +07:00
|
|
|
default: null,
|
|
|
|
|
})
|
2024-03-26 23:07:55 +07:00
|
|
|
positionType: string;
|
2024-03-13 10:52:28 +07:00
|
|
|
|
2024-03-13 10:43:50 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
2024-03-26 23:07:55 +07:00
|
|
|
length: 255,
|
|
|
|
|
comment: "ระดับตำแหน่ง",
|
2024-03-13 10:43:50 +07:00
|
|
|
default: null,
|
|
|
|
|
})
|
2024-03-26 23:07:55 +07:00
|
|
|
positionLevel: string;
|
2024-03-13 10:52:28 +07:00
|
|
|
|
2024-03-13 10:43:50 +07:00
|
|
|
@Column({
|
2024-03-26 23:07:55 +07:00
|
|
|
comment: "เงินเดือนฐาน",
|
|
|
|
|
default: 0,
|
2024-03-13 10:43:50 +07:00
|
|
|
nullable: true,
|
2024-03-26 23:07:55 +07:00
|
|
|
type: "double",
|
2024-03-13 10:43:50 +07:00
|
|
|
})
|
2024-03-26 23:07:55 +07:00
|
|
|
amount: Double;
|
2024-03-13 10:43:50 +07:00
|
|
|
|
2024-12-10 09:49:41 +07:00
|
|
|
@Column({
|
|
|
|
|
comment: "เงินพิเศษ",
|
|
|
|
|
default: 0,
|
|
|
|
|
nullable: true,
|
|
|
|
|
type: "double",
|
|
|
|
|
})
|
|
|
|
|
amountSpecial: Double;
|
|
|
|
|
|
2024-03-13 10:43:50 +07:00
|
|
|
@Column({
|
2024-03-26 23:07:55 +07:00
|
|
|
comment: "เงินประจำตำแหน่ง",
|
|
|
|
|
default: 0,
|
2024-03-13 10:43:50 +07:00
|
|
|
nullable: true,
|
2024-03-26 23:07:55 +07:00
|
|
|
type: "double",
|
2024-03-13 10:43:50 +07:00
|
|
|
})
|
2024-03-26 23:07:55 +07:00
|
|
|
positionSalaryAmount: Double;
|
2024-03-13 10:43:50 +07:00
|
|
|
|
|
|
|
|
@Column({
|
2024-03-26 23:07:55 +07:00
|
|
|
comment: "เงินค่าตอบแทนรายเดือน",
|
|
|
|
|
default: 0,
|
2024-03-13 10:43:50 +07:00
|
|
|
nullable: true,
|
2024-03-26 23:07:55 +07:00
|
|
|
type: "double",
|
2024-03-13 10:43:50 +07:00
|
|
|
})
|
2024-03-26 23:07:55 +07:00
|
|
|
mouthSalaryAmount: Double;
|
2024-03-13 10:43:50 +07:00
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
2024-03-26 23:07:55 +07:00
|
|
|
comment: "เลขที่คำสั่ง",
|
2024-03-13 10:43:50 +07:00
|
|
|
type: "text",
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
refCommandNo: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
2024-03-26 23:07:55 +07:00
|
|
|
comment: "เอกสารอ้างอิง",
|
2024-03-13 10:43:50 +07:00
|
|
|
type: "text",
|
2024-03-26 23:07:55 +07:00
|
|
|
default: null,
|
2024-03-13 10:43:50 +07:00
|
|
|
})
|
2024-03-26 23:07:55 +07:00
|
|
|
templateDoc: string;
|
2024-03-13 10:43:50 +07:00
|
|
|
|
|
|
|
|
@Column({
|
2024-03-26 23:07:55 +07:00
|
|
|
length: 40,
|
|
|
|
|
comment: "คีย์นอก(FK)ของตาราง profileSalary",
|
2024-03-13 10:43:50 +07:00
|
|
|
})
|
2024-03-26 23:07:55 +07:00
|
|
|
profileSalaryId: string;
|
2024-03-13 10:43:50 +07:00
|
|
|
|
2024-03-28 11:44:16 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "ลำดับตำแหน่ง",
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
order: number;
|
|
|
|
|
|
2024-10-18 16:11:22 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
length: 40,
|
|
|
|
|
comment: "คีย์นอก(FK)ของตาราง command",
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
commandId: string;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => Command, (command) => command.profileSalaryHistorys)
|
|
|
|
|
@JoinColumn({ name: "commandId" })
|
|
|
|
|
command: Command;
|
|
|
|
|
|
2024-03-13 10:43:50 +07:00
|
|
|
@ManyToOne(() => ProfileSalary, (profileSalary) => profileSalary.profileSalaryHistories)
|
|
|
|
|
@JoinColumn({ name: "profileSalaryId" })
|
|
|
|
|
histories: ProfileSalary;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class CreateProfileSalaryHistory {
|
|
|
|
|
profileId: string;
|
2024-03-26 23:07:55 +07:00
|
|
|
date?: Date | null;
|
|
|
|
|
amount?: Double | null;
|
2024-12-10 09:49:41 +07:00
|
|
|
amountSpecial?: Double | null;
|
2024-03-26 23:07:55 +07:00
|
|
|
positionSalaryAmount?: Double | null;
|
|
|
|
|
mouthSalaryAmount?: Double | null;
|
|
|
|
|
posNo: string | null;
|
|
|
|
|
position: string | null;
|
|
|
|
|
positionLine: string | null;
|
|
|
|
|
positionPathSide: string | null;
|
|
|
|
|
positionExecutive: string | null;
|
|
|
|
|
positionType: string | null;
|
|
|
|
|
positionLevel: string | null;
|
|
|
|
|
refCommandNo: string | null;
|
|
|
|
|
templateDoc: string | null;
|
2024-03-13 10:43:50 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class UpdateProfileSalaryHistory {
|
2024-03-26 23:07:55 +07:00
|
|
|
date?: Date | null;
|
|
|
|
|
amount?: Double | null;
|
2024-12-10 09:49:41 +07:00
|
|
|
amountSpecial?: Double | null;
|
2024-03-26 23:07:55 +07:00
|
|
|
positionSalaryAmount?: Double | null;
|
|
|
|
|
mouthSalaryAmount?: Double | null;
|
|
|
|
|
posNo?: string | null;
|
|
|
|
|
position?: string | null;
|
|
|
|
|
positionLine?: string | null;
|
|
|
|
|
positionPathSide?: string | null;
|
|
|
|
|
positionExecutive?: string | null;
|
|
|
|
|
positionType?: string | null;
|
|
|
|
|
positionLevel?: string | null;
|
|
|
|
|
refCommandNo?: string | null;
|
|
|
|
|
templateDoc?: string | null;
|
2024-03-13 10:43:50 +07:00
|
|
|
}
|