import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm"; import { EntityBase } from "./base/Base"; import { MetaStateOperator } from "./MetaStateOperator"; import { Workflow } from "./Workflow"; import { metaWorkflow } from "./MetaWorkflow"; @Entity("metaState") export class MetaState extends EntityBase { @Column({ nullable: true, comment: "ชื่อประเภทขั้นตอน", length: 255, default: null, }) name: string; @Column({ nullable: true, comment: "ประเภทขั้นตอน", length: 255, default: null, }) type: string; @Column({ nullable: true, comment: "ลำดับ", default: null, }) order: number; @Column({ nullable: true, length: 40, comment: "คีย์นอก(FK)ของตาราง metaWorkflow", default: null, }) metaWorkflowId: string; @ManyToOne(() => metaWorkflow, (metaWorkflow) => metaWorkflow.metaStates) @JoinColumn({ name: "metaWorkflowId" }) metaWorkflow: metaWorkflow; @OneToMany(() => MetaStateOperator, (metaStateOperator) => metaStateOperator.metaState) metaStateOperators: MetaStateOperator[]; }