import { Entity, Column, ManyToOne, JoinColumn } from "typeorm"; import { EntityBase } from "./base/Base"; import { Development } from "./Development"; @Entity("developmentProjectType") export class DevelopmentProjectType extends EntityBase { @Column({ // STRATEGIC_PROJECT = โครงการตามยุทธศาสตร์ // MISSION_PROJECT = โครงการตามภารกิจประจำของหน่วยงาน // NEW_PROJECT = โครงการใหม่ // ONGOING_PROJECT = โครงการต่อเนื่อง nullable: true, comment: "ประเภทโครงการ", default: null, }) name: string; @Column({ nullable: true, comment: "โครงการ/หลักสูตรการฝึกอบรม", default: null, }) developmentId: string; @ManyToOne(() => Development, (development: Development) => development.developmentProjectTypes) @JoinColumn({ name: "developmentId" }) development: Development; } export class CreateDevelopmentProjectType { @Column() name: string; }