This commit is contained in:
2025-11-10 22:42:32 +03:30
parent 45ca2fde06
commit bca4b75b6a
21 changed files with 54 additions and 654 deletions
-14
View File
@@ -1,14 +0,0 @@
import { Collection, Entity, Enum, OneToMany } from '@mikro-orm/core';
import { User } from '../../users/entities/user.entity';
import { BaseEntity } from '../../../common/entities/base.entity';
import { RoleEnum } from '../enums/role.enum';
@Entity()
export class Role extends BaseEntity {
@Enum({ items: () => RoleEnum, nativeEnumName: 'role_enum', default: RoleEnum.USER })
name!: RoleEnum;
@OneToMany(() => User, user => user.role)
users = new Collection<User>(this);
}