hrms-api-org/src/entities/RoleKeycloak.ts
2024-11-19 10:43:25 +07:00

29 lines
739 B
TypeScript

import { Entity, Column, ManyToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { Profile } from "./Profile";
import { ProfileEmployee } from "./ProfileEmployee";
@Entity("roleKeycloak")
export class RoleKeycloak extends EntityBase {
@Column({
nullable: true,
comment: "ชื่อ role",
length: 255,
default: null,
})
name: string;
@Column({
nullable: true,
comment: "คำอธิบาย",
length: 255,
default: null,
})
description: string;
@ManyToMany(() => Profile, (profile) => profile.roleKeycloaks)
profiles: Profile[];
@ManyToMany(() => ProfileEmployee, (profileEmployee) => profileEmployee.roleKeycloaks)
profileEmployees: ProfileEmployee[];
}