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"; @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(() => PlannedGoal, (plannedGoal: PlannedGoal) => plannedGoal.posTypePlanned) plannedGoals: PlannedGoal[]; @OneToMany(() => DevelopmentHistory, (developmentHistory) => developmentHistory.posType) developmentHistorys: DevelopmentHistory[]; } export class CreatePosType { @Column() posTypeName: string; @Column() posTypeRank: number; } export type UpdatePosType = Partial;