using MediatR;

namespace AdsServingService.API.Application.Queries;

/// <summary>
/// EN: Query to get paginated list of budget pacers.
/// VI: Query lấy danh sách budget pacers phân trang.
/// </summary>
public class GetBudgetPacersQuery : IRequest<PagedResult<BudgetPacerDto>>
{
    public Guid? CampaignId { get; init; }
    public int Page { get; init; } = 1;
    public int PageSize { get; init; } = 20;
}

public record BudgetPacerDto
{
    public Guid Id { get; init; }
    public Guid CampaignId { get; init; }
    public decimal DailyBudget { get; init; }
    public decimal SpentToday { get; init; }
    public decimal RemainingBudget { get; init; }
    public decimal UtilizationPercent { get; init; }
    public string Strategy { get; init; } = string.Empty;
    public DateTime LastUpdated { get; init; }
}

public record BudgetStatisticsDto
{
    public int TotalCampaigns { get; init; }
    public decimal TotalDailyBudget { get; init; }
    public decimal TotalSpentToday { get; init; }
    public decimal AverageUtilization { get; init; }
    public int CampaignsExceeded { get; init; }
}
