add entity AuthRole , AuthRoleAttr , AuthSys

This commit is contained in:
AdisakKanthawilang 2024-06-11 11:22:59 +07:00
parent aa67674fa7
commit 4beef77eb3
3 changed files with 213 additions and 0 deletions

35
src/entities/AuthRole.ts Normal file
View file

@ -0,0 +1,35 @@
import { Entity, Column, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { AuthRoleAttr } from "./AuthRoleAttr";
@Entity("AuthRole")
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[];
}
export class CreateAuthRole {
@Column()
roleName: string;
@Column()
roleDescription: string;
}
export type UpdateAuthRole = Partial<CreateAuthRole>;