import { Entity, Column, ManyToOne, JoinColumn } from "typeorm"; import { EntityBase } from "./base/Base"; import { Development } from "./Development"; import { PosType } from "./PosType"; import { PosLevel } from "./PosLevel"; @Entity("plannedGoal") export class PlannedGoal 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, }) posTypePlannedId: string; @ManyToOne(() => PosType, (posType: PosType) => posType.plannedGoals) @JoinColumn({ name: "posTypePlannedId" }) posTypePlanned: PosType; @Column({ nullable: true, comment: "ระดับตำแหน่ง", default: null, }) posLevelPlannedId: string; @ManyToOne(() => PosLevel, (posLevel: PosLevel) => posLevel.plannedGoals) @JoinColumn({ name: "posLevelPlannedId" }) posLevelPlanned: PosLevel; @Column({ nullable: true, comment: "ประเภท(กลุ่มอาชีพ คุณสมบัติ)", default: null, }) type: string; @Column({ nullable: true, comment: "จำนวน(คน)", default: null, }) amount: number; @Column({ nullable: true, comment: "id โครงการ", default: null, }) developmentPlannedGoalId: string; @ManyToOne(() => Development, (development: Development) => development.developmentPlannedGoals) @JoinColumn({ name: "developmentPlannedGoalId" }) developmentPlannedGoal: Development; } export class CreatePlannedGoal { @Column() groupTarget: string | null; @Column() groupTargetSub: string | null; @Column() position: string | null; @Column() posTypePlannedId: string | null; @Column() posLevelPlannedId: string | null; @Column() type: string | null; @Column() amount: number | null; } export type UpdatePlannedGoal = Partial;