hrms-api-development/src/entities/DevelopmentOther.ts
2024-12-19 12:41:48 +07:00

52 lines
1.4 KiB
TypeScript

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;
}