created Salary entity
This commit is contained in:
parent
a429021f6d
commit
570ca11c84
5 changed files with 353 additions and 0 deletions
104
src/entities/Salarys.ts
Normal file
104
src/entities/Salarys.ts
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
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";
|
||||
|
||||
@Entity("salarys")
|
||||
export class Salarys extends EntityBase {
|
||||
@Column({
|
||||
comment: "ประเภทผัง",
|
||||
length: 255,
|
||||
})
|
||||
salaryType: string;
|
||||
|
||||
@Column({
|
||||
length: 40,
|
||||
comment: "Id ระดับของตำแหน่ง",
|
||||
})
|
||||
posTypeId: string;
|
||||
|
||||
@Column({
|
||||
length: 40,
|
||||
comment: "Id ประเภทของตำแหน่ง",
|
||||
})
|
||||
posLevelId: 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(() => SalaryRanks, (salaryRanks) => salaryRanks.salarys_)
|
||||
salaryRanks_: SalaryRanks[];
|
||||
|
||||
@ManyToOne(() => PosType, (posType) => posType.salarys_)
|
||||
@JoinColumn({ name: "posTypeId" })
|
||||
posType_: PosType;
|
||||
|
||||
@ManyToOne(() => PosLevel, (posLevel) => posLevel.salarys_)
|
||||
@JoinColumn({ name: "posLevelId" })
|
||||
posLevel_: PosLevel;
|
||||
}
|
||||
|
||||
export class CreateSalaryRank {
|
||||
|
||||
@Column()
|
||||
salaryType: string;
|
||||
|
||||
@Column("uuid")
|
||||
posTypeId: string;
|
||||
|
||||
@Column("uuid")
|
||||
posLevelId: string;
|
||||
|
||||
@Column()
|
||||
isActive: boolean;
|
||||
|
||||
@Column()
|
||||
date?: Date;
|
||||
|
||||
@Column()
|
||||
startDate?: Date;
|
||||
|
||||
@Column()
|
||||
endDate?: Date;
|
||||
|
||||
@Column()
|
||||
detail?: string;
|
||||
|
||||
}
|
||||
|
||||
export type UpdateSalaryRank = Partial<CreateSalaryRank> ;
|
||||
Loading…
Add table
Add a link
Reference in a new issue