using CMSMicroservice.Domain.Enums;

namespace CMSMicroservice.Application.ClubMembershipCycleCQ.Queries.GetAllClubMembershipCycleByFilter;

public record GetAllClubMembershipCycleByFilterQuery : IRequest<GetAllClubMembershipCycleByFilterResponseDto>
{
    public PaginationState? PaginationState { get; init; }
    public string? SortBy { get; init; }
    public GetAllClubMembershipCycleByFilterFilter? Filter { get; init; }
}

public class GetAllClubMembershipCycleByFilterFilter
{
    public long? UserId { get; set; }
    public bool? IsCurrentCycle { get; set; }
    public long? PackageId { get; set; }
    public int? CycleNumber { get; set; }
    public PackagePurchaseMethod? PurchaseMethod { get; set; }
    /// <summary>0=none, 1=active magic, 2=completed magic</summary>
    public int? MagicState { get; set; }
    public DateTime? PackagePurchasedFrom { get; set; }
    public DateTime? PackagePurchasedTo { get; set; }
}

public class GetAllClubMembershipCycleByFilterResponseDto
{
    public MetaData MetaData { get; set; }
    public List<GetAllClubMembershipCycleByFilterResponseModel>? Models { get; set; }
}

public class GetAllClubMembershipCycleByFilterResponseModel
{
    public long Id { get; set; }
    public long UserId { get; set; }
    public string UserName { get; set; } = string.Empty;
    public long ClubMembershipId { get; set; }
    public int CycleNumber { get; set; }
    public long PackageId { get; set; }
    public string PackageName { get; set; } = string.Empty;
    public long PackageAmount { get; set; }
    public PackagePurchaseMethod PurchaseMethod { get; set; }
    public DateTime PackagePurchasedAt { get; set; }
    public DateTime? MagicStartedAt { get; set; }
    public DateTime? MagicCompletedAt { get; set; }
    public bool IsCurrentCycle { get; set; }
    public DateTimeOffset Created { get; set; }
}
