namespace adas_core.Domain.Models.Responses;

public class PaginationResponse<T>
{
    public PaginationResponse(List<T> data, int pageNumber, int pageSize, long totalRecords)
    {
        PageNumber = pageNumber;
        PageSize = pageSize;
        Data = data;
        TotalRecords = totalRecords;
        var totalPages = TotalRecords / (double)PageSize;
        var roundedTotalPages = Convert.ToInt64(Math.Ceiling(totalPages));
        TotalPages = roundedTotalPages;
    }

    public int PageNumber { get; set; }
    public int PageSize { get; set; }

    public long TotalPages { get; set; }
    public long TotalRecords { get; set; }
    public List<T> Data { get; set; }
}