import { Collection, Entity, ManyToMany, PrimaryKey, Property, } from '@mikro-orm/core'; import Role from './role.entity'; @Entity() export default class Permission { @PrimaryKey({ type: 'uuid', defaultRaw: 'uuid_generate_v4()', }) id: string; @Property() name: string; @Property() showName: string; @ManyToMany(() => Role, (role) => role.permissions) roles = new Collection(this); }