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

95 lines
2.2 KiB
TypeScript

import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { Development } from "./Development";
import { PosLevel } from "./PosLevel";
import { PosType } from "./PosType";
@Entity("actualGoal")
export class ActualGoal extends EntityBase {
@Column({
nullable: true,
comment: "กลุ่มเป้าหมาย",
default: null,
})
groupTarget: string;
@Column({
nullable: true,
comment: "กลุ่มเป้าหมายย่อย",
default: null,
})
groupTargetSub: string;
@Column({
nullable: true,
comment: "ตำแหน่ง",
default: null,
})
position: string;
@Column({
nullable: true,
comment: "ประเภทตำแหน่ง",
default: null,
})
posTypeActualId: string;
@ManyToOne(() => PosType, (posType: PosType) => posType.actualGoals)
@JoinColumn({ name: "posTypeActualId" })
posTypeActual: PosType;
@Column({
nullable: true,
comment: "ระดับตำแหน่ง",
default: null,
})
posLevelActualId: string;
@ManyToOne(() => PosLevel, (posLevel: PosLevel) => posLevel.actualGoals)
@JoinColumn({ name: "posLevelActualId" })
posLevelActual: PosLevel;
@Column({
nullable: true,
comment: "ประเภท(กลุ่มอาชีพ คุณสมบัติ)",
default: null,
})
type: string;
@Column({
nullable: true,
comment: "จำนวน(คน)",
default: null,
})
amount: number;
@Column({
nullable: true,
comment: "id โครงการ",
default: null,
})
developmentActualGoalId: string;
@ManyToOne(() => Development, (development: Development) => development.developmentActualGoals)
@JoinColumn({ name: "developmentActualGoalId" })
developmentActualGoal: Development;
}
export class CreateActualGoal {
@Column()
groupTarget: string | null;
@Column()
groupTargetSub: string | null;
@Column()
position: string | null;
@Column()
posTypeActualId: string | null;
@Column()
posLevelActualId: string | null;
@Column()
type: string | null;
@Column()
amount: number | null;
}
export type UpdateActualGoal = Partial<CreateActualGoal>;