using MediatR;

namespace MembershipService.API.Application.Queries;

/// <summary>
/// EN: Query to get paginated list of members.
/// VI: Query để lấy danh sách members phân trang.
/// </summary>
public class GetMembersQuery : IRequest<GetMembersResult>
{
    public int PageIndex { get; set; } = 0;
    public int PageSize { get; set; } = 10;
    public string? SearchTerm { get; set; }
}

/// <summary>
/// EN: Result of get members query.
/// VI: Kết quả của get members query.
/// </summary>
public class GetMembersResult
{
    public IEnumerable<MemberDto> Members { get; set; } = Enumerable.Empty<MemberDto>();
    public int TotalCount { get; set; }
    public int PageIndex { get; set; }
    public int PageSize { get; set; }
    public int TotalPages => (int)Math.Ceiling((double)TotalCount / PageSize);
}
