2024-10-08 22:07:04 +07:00
|
|
|
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;
|
|
|
|
|
|
2024-10-09 10:05:39 +07:00
|
|
|
@OneToMany(() => State, (state) => state.workflow)
|
|
|
|
|
states: State[];
|
|
|
|
|
|
2024-10-08 22:07:04 +07:00
|
|
|
// @Column({
|
|
|
|
|
// nullable: true,
|
2024-10-09 10:05:39 +07:00
|
|
|
// length: 40,
|
|
|
|
|
// comment: "คีย์นอก(FK)ของตาราง commandSys",
|
2024-10-08 22:07:04 +07:00
|
|
|
// default: null,
|
|
|
|
|
// })
|
2024-10-09 10:05:39 +07:00
|
|
|
// commandSysId: string;
|
|
|
|
|
|
|
|
|
|
// @ManyToOne(() => CommandSys, (commandSys) => commandSys.workflows)
|
|
|
|
|
// @JoinColumn({ name: "commandSysId" })
|
|
|
|
|
// commandSys: CommandSys;
|
2024-10-08 22:07:04 +07:00
|
|
|
|
|
|
|
|
// @Column({
|
|
|
|
|
// nullable: true,
|
2024-10-09 10:05:39 +07:00
|
|
|
// length: 40,
|
|
|
|
|
// comment: "คีย์นอก(FK)ของตาราง posLevel",
|
2024-10-08 22:07:04 +07:00
|
|
|
// default: null,
|
|
|
|
|
// })
|
2024-10-09 10:05:39 +07:00
|
|
|
// posLevelId: string;
|
|
|
|
|
|
|
|
|
|
// @ManyToOne(() => PosLevel, (posLevel) => posLevel.workflows)
|
|
|
|
|
// @JoinColumn({ name: "posLevelId" })
|
|
|
|
|
// posLevel: PosLevel;
|
2024-10-08 22:07:04 +07:00
|
|
|
|
|
|
|
|
// @Column({
|
|
|
|
|
// nullable: true,
|
2024-10-09 10:05:39 +07:00
|
|
|
// length: 40,
|
|
|
|
|
// comment: "คีย์นอก(FK)ของตาราง posType",
|
2024-10-08 22:07:04 +07:00
|
|
|
// default: null,
|
|
|
|
|
// })
|
2024-10-09 10:05:39 +07:00
|
|
|
// posTypeId: string;
|
2024-10-08 22:07:04 +07:00
|
|
|
|
2024-10-09 10:05:39 +07:00
|
|
|
// @ManyToOne(() => PosType, (posType) => posType.workflows)
|
|
|
|
|
// @JoinColumn({ name: "posTypeId" })
|
|
|
|
|
// posType: PosType;
|
2024-10-08 22:07:04 +07:00
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
2024-10-09 10:05:39 +07:00
|
|
|
comment: "ชื่อระบบ",
|
|
|
|
|
length: 100,
|
2024-10-08 22:07:04 +07:00
|
|
|
default: null,
|
|
|
|
|
})
|
2024-10-09 10:05:39 +07:00
|
|
|
commandSysName: string;
|
2024-10-08 22:07:04 +07:00
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
2024-10-09 10:05:39 +07:00
|
|
|
comment: "ชื่อระดับ",
|
|
|
|
|
length: 100,
|
2024-10-08 22:07:04 +07:00
|
|
|
default: null,
|
|
|
|
|
})
|
2024-10-09 10:05:39 +07:00
|
|
|
posLevelName: string;
|
2024-10-08 22:07:04 +07:00
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
2024-10-09 10:05:39 +07:00
|
|
|
comment: "ชื่อประเภท",
|
|
|
|
|
length: 100,
|
2024-10-08 22:07:04 +07:00
|
|
|
default: null,
|
|
|
|
|
})
|
2024-10-09 10:05:39 +07:00
|
|
|
posTypeName: string;
|
2024-10-08 22:07:04 +07:00
|
|
|
}
|