import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm"; import { EntityBase } from "./base/Base"; import { State } from "./State"; import { CommandSys } from "./CommandSys"; import { PosLevel } from "./PosLevel"; import { PosType } from "./PosType"; @Entity("workflow") export class Workflow extends EntityBase { @Column({ nullable: true, comment: "ชื่อ flow", length: 255, default: null, }) name: string; @Column({ nullable: true, comment: "ระบบ", length: 255, default: null, }) category: string; @OneToMany(() => State, (state) => state.workflow) states: State[]; // @Column({ // nullable: true, // length: 40, // comment: "คีย์นอก(FK)ของตาราง commandSys", // default: null, // }) // commandSysId: string; // @ManyToOne(() => CommandSys, (commandSys) => commandSys.workflows) // @JoinColumn({ name: "commandSysId" }) // commandSys: CommandSys; // @Column({ // nullable: true, // length: 40, // comment: "คีย์นอก(FK)ของตาราง posLevel", // default: null, // }) // posLevelId: string; // @ManyToOne(() => PosLevel, (posLevel) => posLevel.workflows) // @JoinColumn({ name: "posLevelId" }) // posLevel: PosLevel; // @Column({ // nullable: true, // length: 40, // comment: "คีย์นอก(FK)ของตาราง posType", // default: null, // }) // posTypeId: string; // @ManyToOne(() => PosType, (posType) => posType.workflows) // @JoinColumn({ name: "posTypeId" }) // posType: PosType; @Column({ nullable: true, comment: "ชื่อระบบ", length: 100, default: null, }) commandSysName: string; @Column({ nullable: true, comment: "ชื่อระดับ", length: 100, default: null, }) posLevelName: string; @Column({ nullable: true, comment: "ชื่อประเภท", length: 100, default: null, }) posTypeName: string; }