hrms-api-org/src/entities/ProfileSalaryHistory.ts
2024-05-17 09:41:02 +07:00

176 lines
3.7 KiB
TypeScript

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({
// length: 40,
// comment: "คีย์นอก(FK)ของตาราง profile",
// type: "uuid",
// })
// profileId: string;
@Column({
comment: "วันที่",
type: "datetime",
nullable: true,
})
date: Date;
@Column({
nullable: true,
length: 40,
comment: "เลขที่ตำแหน่ง",
default: null,
})
posNo: string;
@Column({
nullable: true,
length: 255,
comment: "ตำแหน่ง",
default: null,
})
position: string;
@Column({
nullable: true,
length: 255,
comment: "สายงาน",
default: null,
})
positionLine: string;
@Column({
nullable: true,
length: 255,
comment: "ด้าน/สาขา",
default: null,
})
positionPathSide: string;
@Column({
nullable: true,
length: 255,
comment: "ตำแหน่งทางการบริหาร",
default: null,
})
positionExecutive: string;
@Column({
nullable: true,
length: 255,
comment: "ประเภทตำแหน่ง",
default: null,
})
positionType: string;
@Column({
nullable: true,
length: 255,
comment: "ระดับตำแหน่ง",
default: null,
})
positionLevel: string;
@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({
nullable: true,
comment: "เลขที่คำสั่ง",
type: "text",
default: null,
})
refCommandNo: string;
@Column({
nullable: true,
comment: "เอกสารอ้างอิง",
type: "text",
default: null,
})
templateDoc: string;
@Column({
length: 40,
comment: "คีย์นอก(FK)ของตาราง profileSalary",
})
profileSalaryId: string;
@Column({
nullable: true,
comment: "ลำดับตำแหน่ง",
default: null,
})
order: number;
@ManyToOne(() => ProfileSalary, (profileSalary) => profileSalary.profileSalaryHistories)
@JoinColumn({ name: "profileSalaryId" })
histories: ProfileSalary;
}
export class CreateProfileSalaryHistory {
profileId: string;
date?: Date | null;
amount?: Double | null;
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;
}
export class UpdateProfileSalaryHistory {
date?: Date | null;
amount?: Double | null;
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;
}