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

454 lines
8.4 KiB
TypeScript
Raw Normal View History

2024-03-13 10:52:28 +07:00
import {
Entity,
Column,
OneToMany,
OneToOne,
JoinColumn,
ManyToMany,
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";
2024-03-13 10:43:50 +07:00
import { ProfileSalaryHistory } from "./ProfileSalaryHistory";
2024-02-23 14:19:39 +07:00
@Entity("profileSalary")
export class ProfileSalary extends EntityBase {
@Column({
comment: "วันที่",
type: "datetime",
nullable: true,
})
date: Date;
@Column({
comment: "เงินเดือนฐาน",
default: 0,
nullable: true,
2024-03-13 10:52:28 +07:00
type: "double",
2024-02-23 14:19:39 +07:00
})
amount: Double;
@Column({
comment: "เงินประจำตำแหน่ง",
default: 0,
nullable: true,
2024-03-13 10:52:28 +07:00
type: "double",
2024-02-23 14:19:39 +07:00
})
positionSalaryAmount: Double;
@Column({
comment: "เงินค่าตอบแทนรายเดือน",
default: 0,
nullable: true,
2024-03-13 10:52:28 +07:00
type: "double",
2024-02-23 14:19:39 +07:00
})
mouthSalaryAmount: Double;
@Column({
length: 40,
2024-03-08 14:18:46 +07:00
comment: "คีย์นอก(FK)ของตาราง profile",
2024-03-13 10:52:28 +07:00
type: "uuid",
2024-02-23 14:19:39 +07:00
})
profileId: string;
2024-03-13 10:43:50 +07:00
@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,
})
2024-03-13 10:52:28 +07:00
positionExecutiveId: string;
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
length: 40,
comment: "Id ด้านทางการบริหาร",
type: "uuid",
default: null,
})
2024-03-13 10:52:28 +07:00
positionExecutiveSideId: string;
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
length: 40,
comment: "",
type: "uuid",
default: null,
})
2024-03-13 10:52:28 +07:00
positionLevelId: string;
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
length: 40,
comment: "Id สายงาน",
type: "uuid",
default: null,
})
2024-03-13 10:52:28 +07:00
positionLineId: string;
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
length: 40,
comment: "Id ด้าน/สาขา",
type: "uuid",
default: null,
})
2024-03-13 10:52:28 +07:00
positionPathSideId: string;
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
length: 40,
comment: "Id ประเภทตำแหน่ง",
type: "uuid",
default: null,
})
2024-03-13 10:52:28 +07:00
positionTypeId: string;
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
length: 40,
comment: "Id ชื่อย่อหน่วยงาน",
type: "uuid",
default: null,
})
2024-03-13 10:52:28 +07:00
organizationShortNameId: string;
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
length: 40,
comment: "Id กลุ่มงาน",
type: "uuid",
default: null,
})
2024-03-13 10:52:28 +07:00
positionEmployeeGroupId: string;
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
length: 40,
comment: "Id ระดับชั้นงาน",
type: "uuid",
default: null,
})
2024-03-13 10:52:28 +07:00
positionEmployeeLevelId: string;
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
length: 40,
comment: "Id ตำแหน่ง",
type: "uuid",
default: null,
})
2024-03-13 10:52:28 +07:00
positionEmployeePositionId: string;
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
length: 40,
comment: "Id ด้านของตำแหน่ง",
type: "uuid",
default: null,
})
2024-03-13 10:52:28 +07:00
positionEmployeePositionSideId: string;
2024-03-13 10:43:50 +07:00
@Column({
nullable: true,
length: 40,
comment: "Id เลขที่ตำแหน่งลูกจ้าง",
default: null,
})
2024-03-13 10:52:28 +07:00
posNoEmployee: string;
2024-03-13 10:43:50 +07:00
@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[];
2024-02-23 14:19:39 +07:00
@ManyToOne(() => Profile, (profile) => profile.profileSalary)
@JoinColumn({ name: "profileId" })
profile: Profile;
}
2024-02-23 15:15:11 +07:00
export class CreateProfileSalary {
@Column({
2024-03-13 10:52:28 +07:00
type: "datetime",
2024-02-23 15:15:11 +07:00
})
date: Date;
2024-02-23 14:19:39 +07:00
2024-02-23 15:15:11 +07:00
@Column({
2024-03-13 10:52:28 +07:00
type: "double",
2024-02-23 15:15:11 +07:00
})
amount: Double;
2024-02-23 14:19:39 +07:00
2024-02-23 15:15:11 +07:00
@Column({
2024-03-13 10:52:28 +07:00
type: "double",
2024-02-23 15:15:11 +07:00
})
positionSalaryAmount: Double;
2024-02-23 14:19:39 +07:00
2024-02-23 15:15:11 +07:00
@Column({
2024-03-13 10:52:28 +07:00
type: "double",
2024-02-23 15:15:11 +07:00
})
mouthSalaryAmount: Double;
2024-03-13 10:52:28 +07:00
2024-02-23 15:15:11 +07:00
@Column({
2024-03-13 10:52:28 +07:00
type: "uuid",
2024-02-23 15:15:11 +07:00
})
profileId: string;
2024-02-23 14:19:39 +07:00
2024-03-13 10:43:50 +07:00
// @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")
2024-03-13 10:52:28 +07:00
// positionLevelId : string | null;
2024-03-13 10:43:50 +07:00
// @Column("uuid")
// positionLineId : string | null;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
// @Column("uuid")
// positionPathSideId : string | null;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
// @Column("uuid")
// positionTypeId : string | null;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
// @Column("uuid")
// organizationShortNameId : string | null;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
// @Column("uuid")
// positionEmployeeGroupId : string | null;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
// @Column("uuid")
// positionEmployeeLevelId : string | null;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
// @Column("uuid")
// positionEmployeePositionId : string | null;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
// @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;
2024-02-23 15:15:11 +07:00
}
2024-02-23 14:19:39 +07:00
2024-02-23 15:15:11 +07:00
export class UpdateProfileSalary {
@Column({
2024-03-13 10:52:28 +07:00
type: "datetime",
2024-02-23 15:15:11 +07:00
})
date: Date;
2024-02-23 14:19:39 +07:00
2024-02-23 15:15:11 +07:00
@Column({
2024-03-13 10:52:28 +07:00
type: "double",
2024-02-23 15:15:11 +07:00
})
amount: Double;
2024-02-23 14:19:39 +07:00
2024-02-23 15:15:11 +07:00
@Column({
2024-03-13 10:52:28 +07:00
type: "double",
2024-02-23 15:15:11 +07:00
})
positionSalaryAmount: Double;
2024-02-23 14:19:39 +07:00
2024-02-23 15:15:11 +07:00
@Column({
2024-03-13 10:52:28 +07:00
type: "double",
2024-02-23 15:15:11 +07:00
})
mouthSalaryAmount: Double;
2024-02-23 14:19:39 +07:00
2024-03-13 10:52:28 +07:00
// @Column()
2024-03-13 10:43:50 +07:00
// 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")
2024-03-13 10:52:28 +07:00
// positionLevelId : string | null;
2024-03-13 10:43:50 +07:00
// @Column("uuid")
// positionLineId : string | null;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
// @Column("uuid")
// positionPathSideId : string | null;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
// @Column("uuid")
// positionTypeId : string | null;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
// @Column("uuid")
// organizationShortNameId : string | null;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
// @Column("uuid")
// positionEmployeeGroupId : string | null;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
// @Column("uuid")
// positionEmployeeLevelId : string | null;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
// @Column("uuid")
// positionEmployeePositionId : string | null;
2024-03-13 10:52:28 +07:00
2024-03-13 10:43:50 +07:00
// @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;
2024-02-23 15:15:11 +07:00
}