using MediatR;

namespace IamService.API.Application.Queries.Roles;

/// <summary>
/// EN: Query to get all roles with pagination.
/// VI: Query để lấy tất cả roles với phân trang.
/// </summary>
/// <param name="PageNumber">Page number / Số trang</param>
/// <param name="PageSize">Page size / Kích thước trang</param>
public record GetRolesQuery(
    int PageNumber = 1,
    int PageSize = 10) : IRequest<GetRolesQueryResult>;

/// <summary>
/// EN: Result of GetRolesQuery.
/// VI: Kết quả của GetRolesQuery.
/// </summary>
public record GetRolesQueryResult(
    IReadOnlyList<RoleDto> Roles,
    int TotalCount,
    int PageNumber,
    int PageSize);

/// <summary>
/// EN: Role DTO for query results.
/// VI: Role DTO cho kết quả query.
/// </summary>
public record RoleDto(
    Guid Id,
    string Name,
    string? Description,
    bool IsSystemRole,
    DateTime CreatedAt,
    int UserCount = 0,
    IReadOnlyList<string>? Permissions = null);
