UNPKG

@upv/ushi-shared

Version:

Shared DTOs, types, and utilities for the USHI platform (LMS, Trials, Social, Wallet).

35 lines (34 loc) 1.22 kB
import BaseDto from '../base/BaseDto'; import { IRoleDto, IRole } from '../../../types/role'; import { PersonRole, RoleDomain } from '../../enums'; /** * RoleDto * * Data Transfer Object for Role entities in the USHI platform. * Encapsulates role identity (e.g., 'admin', 'student') and domain scope (e.g., LMS, Trial), * providing consistent serialization and access to role data. */ declare class RoleDto extends BaseDto<IRoleDto> { protected _key: PersonRole; protected _label: string; protected _domain: RoleDomain; protected _description?: string; /** * Constructs a new RoleDto instance. * @param data - Raw role DTO input */ constructor(data: IRoleDto); /** * Serializes the RoleDto into a plain IRole object. */ serialize(): Promise<IRole>; /** Gets the role key (e.g., 'admin', 'student') */ get key(): PersonRole; /** Gets the user-facing label for this role (e.g., 'Administrator') */ get label(): string; /** Gets the domain in which this role applies (e.g., LMS, Trial) */ get domain(): RoleDomain; /** Gets the optional description of the role */ get description(): string | undefined; } export default RoleDto;