using CMSMicroservice.Domain.Enums;

namespace CMSMicroservice.Application.UserPackagePurchaseCQ.Queries.GetCustomerPackagePurchaseRollup;

public record GetCustomerPackagePurchaseRollupQuery : IRequest<GetCustomerPackagePurchaseRollupResponseDto>
{
    public PaginationState? PaginationState { get; init; }
    public GetCustomerPackagePurchaseRollupFilter? Filter { get; init; }
}

public class GetCustomerPackagePurchaseRollupFilter
{
    public long? UserId { get; set; }
    public PackagePurchaseMethod? PurchaseMethod { get; set; }
    public DateTime? PurchasedFrom { get; set; }
    public DateTime? PurchasedTo { get; set; }
}

public class GetCustomerPackagePurchaseRollupResponseDto
{
    public MetaData MetaData { get; set; } = new();
    public List<CustomerPackagePurchaseRollupModel> Models { get; set; } = new();
}

public class CustomerPackagePurchaseRollupModel
{
    public long UserId { get; set; }
    public string UserName { get; set; } = string.Empty;
    public string UserMobile { get; set; } = string.Empty;

    public long FirstPackageId { get; set; }
    public string FirstPackageName { get; set; } = string.Empty;
    public long FirstAmount { get; set; }
    public DateTime FirstPurchasedAt { get; set; }

    public long LastPackageId { get; set; }
    public string LastPackageName { get; set; } = string.Empty;
    public long LastAmount { get; set; }
    public DateTime LastPurchasedAt { get; set; }
    public PackagePurchaseMethod LastPurchaseMethod { get; set; }

    public int PurchaseCount { get; set; }
    public long TotalAmount { get; set; }

    public int DayaCount { get; set; }
    public long DayaAmount { get; set; }
    public int ManualCount { get; set; }
    public long ManualAmount { get; set; }
    public int GatewayCount { get; set; }
    public long GatewayAmount { get; set; }
}
