ผังเงินเดือนลูกจ้าง

This commit is contained in:
Kittapath 2024-03-13 09:30:04 +07:00
parent 0cf3d3dc85
commit 87f29e22e9
7 changed files with 699 additions and 61 deletions

View file

@ -0,0 +1,66 @@
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { Salarys } from "./Salarys";
import { SalaryEmployees } from "./SalaryEmployees";
@Entity("salaryRankEmployees")
export class SalaryRankEmployees extends EntityBase {
@Column({
length: 40,
comment: "คีย์นอก(FK)ของตาราง salaryEmployee",
})
salaryEmployeeId: string;
@Column({
type: "double",
comment: "ลำดับขั้น",
})
step: number;
@Column({
nullable: true,
type: "double",
comment: "ค่าจ้างรายเดือน",
default: null,
})
salaryMounth: number | null;
@Column({
nullable: true,
type: "double",
comment: "ค่าจ้างรายวัน",
default: null,
})
salaryDay: number | null;
@ManyToOne(() => SalaryEmployees, (salaryEmployees) => salaryEmployees.salaryRankEmployees_)
@JoinColumn({ name: "salaryEmployeeId" })
salaryEmployees_: SalaryEmployees;
}
export class CreateSalaryRankEmployee {
@Column("uuid")
salaryEmployeeId: string;
@Column()
step: number;
@Column()
salaryMounth?: number | null;
@Column()
salaryDay?: number | null;
}
export class UpdateSalaryRankEmployee {
@Column()
step: number;
@Column()
salaryMounth?: number | null;
@Column()
salaryDay?: number | null;
}
// export type UpdateSalaryRank = Partial<Pick<CreateSalaryRank, Exclude<keyof CreateSalaryRank, 'salaryId'>>>;