import { Entity, Column, JoinColumn, ManyToOne, OneToMany } from "typeorm"; import { EntityBase } from "./base/Base"; import { Command } from "./Command"; import { Profile } from "./Profile"; import { CommandSendCC } from "./CommandSendCC"; @Entity("commandSend") export class CommandSend extends EntityBase { @Column({ nullable: true, comment: "เลขประจำตัวประชาชน", length: 255, default: null, }) citizenId: string; @Column({ nullable: true, comment: "คำนำหน้า", length: 255, default: null, }) prefix: string; @Column({ nullable: true, comment: "ชื่อ", length: 255, default: null, }) firstName: string; @Column({ nullable: true, comment: "สกุล", length: 255, default: null, }) lastName: string; @Column({ nullable: true, comment: "ตำแหน่ง", length: 255, default: null, }) position: string; @Column({ nullable: true, comment: "หน่วยงาน", length: 255, default: null, }) org: string; @Column({ length: 40, comment: "คีย์นอก(FK)ของตาราง command", }) commandId: string; @ManyToOne(() => Command, (command) => command.commandSends) @JoinColumn({ name: "commandId" }) command: Command; @Column({ length: 40, comment: "คีย์นอก(FK)ของตาราง profile", }) profileId: string; @ManyToOne(() => Profile, (profile) => profile.commandSends) @JoinColumn({ name: "profileId" }) profile: Profile; @OneToMany(() => CommandSendCC, (commandSendCC) => commandSendCC.commandSend) commandSendCCs: CommandSendCC[]; } export class CreateCommandSend { @Column() name: string; } // export type UpdateCommandSend = Partial;