created Salary entity
This commit is contained in:
parent
a429021f6d
commit
570ca11c84
5 changed files with 353 additions and 0 deletions
67
src/entities/PosLevel.ts
Normal file
67
src/entities/PosLevel.ts
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { PosType } from "./PosType";
|
||||
import { profile } from "console";
|
||||
import { Salarys } from "./Salarys";
|
||||
|
||||
enum PosLevelAuthority {
|
||||
HEAD = "HEAD",
|
||||
DEPUTY = "DEPUTY",
|
||||
GOVERNOR = "GOVERNOR",
|
||||
}
|
||||
@Entity("posLevel")
|
||||
export class PosLevel extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อระดับตำแหน่ง",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
posLevelName: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ระดับของระดับตำแหน่ง",
|
||||
default: null,
|
||||
})
|
||||
posLevelRank: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment:
|
||||
"ผู้มีอำนาจสั่งบรรจุของระดับนี้ head = หัวหน้าหน่วยงาน , deputy = ปลัด , governor = ผู้ว่าฯ",
|
||||
type: "enum",
|
||||
enum: PosLevelAuthority,
|
||||
default: null,
|
||||
})
|
||||
posLevelAuthority: PosLevelAuthority;
|
||||
|
||||
@Column({
|
||||
length: 40,
|
||||
comment: "เป็นระดับของประเภทตำแหน่งใด",
|
||||
})
|
||||
posTypeId: string;
|
||||
|
||||
@OneToMany(() => Salarys, (salary) => salary.posLevel_)
|
||||
salarys_: Salarys[];
|
||||
|
||||
@ManyToOne(() => PosType, (posType) => posType.posLevels)
|
||||
@JoinColumn({ name: "posTypeId" })
|
||||
posType: PosType;
|
||||
}
|
||||
|
||||
export class CreatePosLevel {
|
||||
@Column()
|
||||
posLevelName: string;
|
||||
|
||||
@Column()
|
||||
posLevelRank: number;
|
||||
|
||||
@Column()
|
||||
posLevelAuthority: string;
|
||||
|
||||
@Column("uuid")
|
||||
posTypeId: string;
|
||||
}
|
||||
|
||||
export type UpdatePosLevel = Partial<CreatePosLevel> & { posLevelAuthority?: PosLevelAuthority };
|
||||
Loading…
Add table
Add a link
Reference in a new issue