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