40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
|
|
import { EntityBase } from "./base/Base";
|
|
import { PosLevel } from "./PosLevel";
|
|
import { Salarys } from "./Salarys";
|
|
|
|
@Entity("posType")
|
|
export class PosType extends EntityBase {
|
|
@Column({
|
|
nullable: true,
|
|
comment: "ชื่อประเภทตำแหน่ง (ทั่วไป วิชาการ อำนวยการ บริหาร)",
|
|
length: 255,
|
|
default: null,
|
|
})
|
|
posTypeName: string;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
comment:
|
|
"ระดับของประเภทตำแหน่ง ไว้ใช้ระบุว่าประเภทตำแหน่งนี้อยู่ระดับสูงหรือต่ำกว่ากัน โดย 1 = ต่ำกว่า , มากกว่า 1 = สูงกว่า ทั่วไป = 1 วิชาการ = 2 อำนวยการ = 3 บริหาร = 4",
|
|
default: null,
|
|
})
|
|
posTypeRank: number;
|
|
|
|
@OneToMany(() => PosLevel, (posLevel) => posLevel.posType)
|
|
posLevels: PosLevel[];
|
|
|
|
@OneToMany(() => Salarys, (salary) => salary.posType_)
|
|
salarys_: Salarys[];
|
|
|
|
}
|
|
|
|
export class CreatePosType {
|
|
@Column()
|
|
posTypeName: string;
|
|
|
|
@Column()
|
|
posTypeRank: number;
|
|
}
|
|
|
|
export type UpdatePosType = Partial<CreatePosType>;
|