import { EntityRepository } from '@mikro-orm/core';
import { UserRole } from '@/apps/_app/entities/user/UserRole';
import { UserRoleType } from '@/constants/roles';

export class UserRoleRepository extends EntityRepository<UserRole> {
    async findRoleByName(roleName: UserRoleType): Promise<UserRole | null> {
        return this.findOne({ name: roleName });
    }
}
