hrms-api-org/src/entities/StateOperatorUser.ts

70 lines
1.7 KiB
TypeScript
Raw Normal View History

2024-10-17 11:33:35 +07:00
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
2024-10-09 14:14:36 +07:00
import { EntityBase } from "./base/Base";
import { Workflow } from "./Workflow";
2024-10-16 11:55:45 +07:00
import { Profile } from "./Profile";
2024-11-19 10:43:25 +07:00
import { ProfileEmployee } from "./ProfileEmployee";
2024-10-09 14:14:36 +07:00
@Entity("stateOperatorUser")
export class StateOperatorUser extends EntityBase {
@Column({
nullable: true,
2024-10-09 16:20:43 +07:00
comment: "ผู้ดำเนินการ",
2024-10-09 14:14:36 +07:00
length: 255,
default: null,
})
2024-10-09 16:20:43 +07:00
operator: string;
2024-10-09 14:14:36 +07:00
2024-11-19 10:43:25 +07:00
@Column({
nullable: true,
comment: "ผู้ใช้งาน",
length: 255,
default: null,
})
profileType: string;
2024-10-09 14:14:36 +07:00
@Column({
nullable: true,
comment: "ลำดับ",
default: null,
})
2024-10-09 16:20:43 +07:00
order: number;
2024-10-09 14:14:36 +07:00
@Column({
nullable: true,
length: 40,
2024-10-09 16:20:43 +07:00
comment: "คีย์นอก(FK)ของตาราง workflow",
2024-10-09 14:14:36 +07:00
default: null,
})
2024-10-09 16:20:43 +07:00
workflowId: string;
2024-10-09 14:14:36 +07:00
2024-10-09 16:20:43 +07:00
@ManyToOne(() => Workflow, (workflow) => workflow.stateOperatorUsers)
@JoinColumn({ name: "workflowId" })
workflow: Workflow;
2024-10-16 11:55:45 +07:00
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง profile",
type: "uuid",
default: null,
})
profileId: string;
@ManyToOne(() => Profile, (profile) => profile.stateOperatorUsers)
@JoinColumn({ name: "profileId" })
profile: Profile;
2024-11-19 10:43:25 +07:00
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง profileEmployee",
type: "uuid",
default: null,
})
profileEmployeeId: string;
@ManyToOne(() => ProfileEmployee, (profileEmployee) => profileEmployee.stateOperatorUsers)
@JoinColumn({ name: "profileEmployeeId" })
profileEmployee: ProfileEmployee;
2024-10-09 14:14:36 +07:00
}