import { Entity, Column, PrimaryGeneratedColumn, ManyToOne, JoinColumn } from "typeorm"; import { EntityBase } from "./base/Base"; import { Appoint } from "./Appoint"; @Entity("appointDirector") export class AppointDirector extends EntityBase { @PrimaryGeneratedColumn("uuid") id: string; @Column({ nullable: false, comment: "id ของการแต่งตั้งกรรมการ", }) appointId: string; @Column({ nullable: false, comment: "id ของคน", }) profileId: string; @Column({ nullable: false, comment: "ชื่อ-นามสกุลของประธาน/กรรมการ", }) name: string; @Column({ nullable: true, comment: "ตำแหน่ง", }) position: string; @Column({ nullable: true, comment: "ประเภทตำแหน่ง", }) positionType: string; @Column({ nullable: true, comment: "ระดับตำแหน่ง", }) positionLevel: string; @Column({ type: "enum", enum: ["chairman", "committee", "caregiver"], nullable: false, default: "committee", comment: "บทบาท ประธาน/กรรมการ/ผู้ดูแล", }) role: string; @ManyToOne(() => Appoint, (appoint: Appoint) => appoint.directors) @JoinColumn({ name: "appointId" }) appoint: Appoint; }