using System.Text.Json.Serialization;

namespace e_suite.CustomerApi.models;

public class Paginated<T>
{
    [JsonPropertyName("count")]
    public long Count { get; set; }

    [JsonPropertyName("pageSize")]
    public int PageSize { get; set; }

    [JsonPropertyName("page")]
    public int Page { get; set; }

    [JsonIgnore]
    public int TotalPages => Convert.ToInt32(Math.Ceiling(Count / Convert.ToDecimal(PageSize)));

    [JsonPropertyName("data")]
    public List<T> Data { get; set; } = new List<T>();
}