hrms-api-development/src/entities/PosType.ts

64 lines
2.2 KiB
TypeScript

import { Entity, Column, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { PosLevel } from "./PosLevel";
import { ActualGoal } from "./ActualGoal";
import { PlannedGoal } from "./PlannedGoal";
import { DevelopmentHistory } from "./DevelopmentHistory";
import { DevelopmentScholarship } from "./DevelopmentScholarship";
import { PlannedGoalPosition } from "./PlannedGoalPosition";
@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) => posLevel.posType)
posLevels: PosLevel[];
// @OneToMany(() => ActualGoal, (actualGoal: ActualGoal) => actualGoal.posTypeActual)
// actualGoals: ActualGoal[];
// @OneToMany(
// () => PlannedGoalPosition,
// (plannedGoalPosition: PlannedGoalPosition) => plannedGoalPosition.posTypePlanned,
// )
// plannedGoalPositions: PlannedGoalPosition[];
@OneToMany(() => DevelopmentHistory, (developmentHistory) => developmentHistory.posType)
developmentHistorys: DevelopmentHistory[];
@OneToMany(
() => DevelopmentScholarship,
(developmentScholarship) => developmentScholarship.posType,
)
developmentScholars: DevelopmentScholarship[];
@OneToMany(
() => DevelopmentScholarship,
(developmentScholarship) => developmentScholarship.posTypeguarantor,
)
developmentScholarGuarantors: DevelopmentScholarship[];
}
export class CreatePosType {
@Column()
posTypeName: string;
@Column()
posTypeRank: number;
}
export type UpdatePosType = Partial<CreatePosType>;