import { Entity, Column, ManyToOne, JoinColumn } from "typeorm"; import { EntityBase } from "./base/Base"; import { ProfileAssistance } from "./ProfileAssistance"; @Entity("profileAssistanceHistory") export class ProfileAssistanceHistory extends EntityBase { @Column({ nullable: true, comment: "หน่วยงานที่ให้ช่วยราชการ", default: null, }) agency: string; @Column({ nullable: true, type: "datetime", comment: "วันเริ่มช่วยราชการ", default: null, }) dateStart: Date; @Column({ nullable: true, type: "datetime", comment: "วันสิ้นสุดการช่วยราชการ", default: null, }) dateEnd: Date; @Column({ nullable: true, comment: "เลขที่คำสั่ง", default: null, }) commandNo: string; @Column({ nullable: true, comment: "ชื่อคำสั่ง", default: null, }) commandName: string; @Column({ nullable: true, comment: "เอกสารอ้างอิง", default: null, }) document: string; @Column({ comment: "แนบไฟล์เอกสาร", default: false, }) isUpload: boolean; @Column({ nullable: true, length: 40, comment: "คีย์นอก(FK)ของตาราง ProfileAssistance", default: null, }) profileAssistanceId: string; @Column({ nullable: false, comment: "สถานะลบข้อมูล", default: false, }) isDeleted: boolean; @ManyToOne( () => ProfileAssistance, (profileAssistance) => profileAssistance.profileAssistanceHistorys, ) @JoinColumn({ name: "profileAssistanceId" }) histories: ProfileAssistance; }