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

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,112 @@
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { SalaryRanks } from "./SalaryRanks";
import { PosType } from "./PosType";
import { PosLevel } from "./PosLevel";
import { SalaryRankEmployees } from "./SalaryRankEmployees";
@Entity("salaryEmployees")
export class SalaryEmployees extends EntityBase {
@Column({
comment: "ชื่อผัง",
length: 255,
})
name: string;
@Column({
length: 40,
comment: "กลุ่มบัญชีการจ้าง",
})
group: string;
@Column({
comment: "สถานะการใช้งาน",
})
isActive: boolean;
@Column({
nullable: true,
type: "datetime",
comment: "ให้ไว้ ณ วันที่",
default: null,
})
date: Date;
@Column({
nullable: true,
type: "datetime",
comment: "วันที่มีผลบังคับใช้",
default: null,
})
startDate: Date;
@Column({
nullable: true,
type: "datetime",
comment: "วันที่สิ้นสุดบังคับใช้",
default: null,
})
endDate: Date;
@Column({
nullable: true,
comment: "คำอธิบาย",
length: 255,
default: null,
})
details: string;
@OneToMany(
() => SalaryRankEmployees,
(salaryRankEmployees) => salaryRankEmployees.salaryEmployees_,
)
salaryRankEmployees_: SalaryRankEmployees[];
}
export class CreateSalaryEmployee {
@Column()
name: string;
@Column()
group: string;
@Column()
isActive: boolean;
@Column()
date?: Date | null;
@Column()
startDate?: Date | null;
@Column()
endDate?: Date | null;
@Column()
details?: string | null;
}
export class UpdateSalaryEmployee {
@Column()
name: string;
@Column()
group: string;
@Column()
isActive: boolean;
@Column()
date?: Date | null;
@Column()
startDate?: Date | null;
@Column()
endDate?: Date | null;
@Column()
details?: string | null;
}
// export type UpdateSalary = Partial<CreateSalary> ;

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'>>>;