2024-10-18 11:45:16 +07:00
|
|
|
import { Entity, Column, OneToMany } from "typeorm";
|
2024-06-11 11:22:59 +07:00
|
|
|
import { EntityBase } from "./base/Base";
|
|
|
|
|
import { AuthRoleAttr } from "./AuthRoleAttr";
|
2024-06-13 14:18:20 +07:00
|
|
|
import { PosMaster } from "./PosMaster";
|
2024-06-13 14:41:47 +07:00
|
|
|
import { EmployeePosMaster } from "../entities/EmployeePosMaster";
|
2025-02-20 13:29:29 +07:00
|
|
|
import { EmployeeTempPosMaster } from "./EmployeeTempPosMaster";
|
2024-06-11 11:22:59 +07:00
|
|
|
|
2024-06-11 13:19:38 +07:00
|
|
|
@Entity("authRole")
|
2024-06-11 11:22:59 +07:00
|
|
|
export class AuthRole extends EntityBase {
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "ชื่อบทบาท",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
roleName: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "รายละเอียด",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
roleDescription: string;
|
|
|
|
|
|
|
|
|
|
@OneToMany(() => AuthRoleAttr, (authRoleAttr) => authRoleAttr.authRoleAttrForRole)
|
|
|
|
|
authRoles: AuthRoleAttr[];
|
2024-06-13 14:18:20 +07:00
|
|
|
|
2024-06-14 13:27:02 +07:00
|
|
|
@OneToMany(() => PosMaster, (posMaster) => posMaster.authRole)
|
2024-07-25 09:54:44 +07:00
|
|
|
posMasters: PosMaster[];
|
2024-06-13 14:41:47 +07:00
|
|
|
|
2024-06-14 13:27:02 +07:00
|
|
|
@OneToMany(() => EmployeePosMaster, (posMasters) => posMasters.authRole)
|
2024-07-25 09:54:44 +07:00
|
|
|
posMasterEmps: EmployeePosMaster[];
|
2025-02-20 13:29:29 +07:00
|
|
|
|
|
|
|
|
@OneToMany(() => EmployeeTempPosMaster, (posMasters) => posMasters.authRole)
|
|
|
|
|
posMasterEmpTemps: EmployeeTempPosMaster[];
|
2024-06-11 11:22:59 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class CreateAuthRole {
|
|
|
|
|
@Column()
|
|
|
|
|
roleName: string;
|
|
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
|
roleDescription: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type UpdateAuthRole = Partial<CreateAuthRole>;
|
2024-06-13 14:41:47 +07:00
|
|
|
|
|
|
|
|
export class CreateAddAuthRole {
|
|
|
|
|
@Column()
|
|
|
|
|
authRoleId: string;
|
|
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
|
posMasterId: string;
|
2024-07-25 09:54:44 +07:00
|
|
|
}
|