hrms-api-org/src/entities/StateOperatorUser.ts
2024-10-09 16:20:43 +07:00

50 lines
1.1 KiB
TypeScript

import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { StateOperator } from "./StateOperator";
import { Workflow } from "./Workflow";
@Entity("stateOperatorUser")
export class StateOperatorUser extends EntityBase {
@Column({
nullable: true,
comment: "ผู้ดำเนินการ",
length: 255,
default: null,
})
operator: string;
@Column({
nullable: true,
comment: "",
length: 255,
default: null,
})
profile: string;
@Column({
nullable: true,
comment: "ลำดับ",
default: null,
})
order: number;
@Column({
nullable: true,
comment: "ผู้ดำเนินการ",
length: 255,
default: null,
})
refId: string;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง workflow",
default: null,
})
workflowId: string;
@ManyToOne(() => Workflow, (workflow) => workflow.stateOperatorUsers)
@JoinColumn({ name: "workflowId" })
workflow: Workflow;
}