import { Entity, Column, ManyToOne, JoinColumn } from "typeorm"; import { EntityBase } from "./base/Base"; import { ProfileHonor } from "./ProfileHonor"; @Entity("profileHonorHistory") export class ProfileHonorHistory extends EntityBase { @Column({ nullable: true, length: 2000, comment: "รายละเอียด", default: null, }) detail: string; @Column({ nullable: true, type: "datetime", comment: "วันที่ได้รับ", default: null, }) issueDate: Date; @Column({ nullable: true, length: 200, comment: "หน่วยงานที่ออก", default: null, }) issuer: string; @Column({ nullable: true, length: 200, comment: "ประเภท", default: null, }) type: string; @Column({ nullable: true, type: "datetime", comment: "เอกสารอ้างอิง (ลงวันที่)", default: null, }) refCommandDate: Date; @Column({ nullable: true, comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)", type: "text", default: null, }) refCommandNo: string; @Column({ nullable: true, length: 40, comment: "คีย์นอก(FK)ของตาราง ProfileHonor", default: null, }) profileHonorId: string; @Column({ nullable: true, comment: "ประเภทช่วงเวลาการศึกษา", default: null, }) isDate: boolean; @Column({ comment: "แนบไฟล์เอกสาร", default: false, }) isUpload: boolean; @ManyToOne(() => ProfileHonor, (profileHonor) => profileHonor.profileHonorHistories) @JoinColumn({ name: "profileHonorId" }) histories: ProfileHonor; } export class CreateProfileHonorHistory { @Column() detail: string | null; @Column() issueDate: Date | null; @Column() issuer: string | null; @Column() refCommandDate: Date | null; @Column() refCommandNo: string | null; @Column() isDate: boolean | null; @Column("uuid") profileHonorId: string | null; } export type UpdateProfileHonorHistory = Partial;