import { Entity, Column, ManyToOne, JoinColumn } from "typeorm"; import { EntityBase } from "./base/Base"; import { Development } from "./Development"; import { Province } from "./Province"; @Entity("developmentOther") export class DevelopmentOther extends EntityBase { @Column({ nullable: true, comment: "หัวข้อ/ประเด็นการฝึกอบรม ศึกษาดูงาน", default: null, }) topicAcademic: string; @Column({ nullable: true, comment: "สถานที่ฝึกอบรม ศึกษาดูงาน", default: null, }) addressAcademic: string; @Column({ nullable: true, comment: "จังหวัด(ข้อมูลวิชาการ)", default: null, }) provinceActualId: string; @Column({ nullable: true, comment: "คีย์นอก(FK)ของตาราง development", default: null, }) developmentId: string; @ManyToOne(() => Development, (development: Development) => development.developmentOthers) @JoinColumn({ name: "developmentId" }) development: Development; @ManyToOne(() => Province, (province: Province) => province.developmentOthers) @JoinColumn({ name: "provinceActualId" }) province: Province; } export class UpdateDevelopmentOther { @Column() topicAcademic: string | null; @Column() addressAcademic: string | null; @Column() provinceActualId: string | null; }