- Implemented Create, Delete, Get, and Update validators for Product Galleries. - Added Create, Delete, Get, and Update validators for Product Tags. - Created service classes for handling Discount Categories, Discount Orders, Discount Products, Discount Shopping Cart, Product Categories, Product Galleries, and Product Tags. - Each service class integrates with CQRS for command and query handling. - Established mapping profiles for Product Galleries.
173 lines
4.3 KiB
C#
173 lines
4.3 KiB
C#
using CMSMicroservice.Domain.Enums;
|
|
|
|
namespace CMSMicroservice.Application.CommissionCQ.Queries.GetWithdrawalReports;
|
|
|
|
/// <summary>
|
|
/// Query برای دریافت گزارش برداشتها
|
|
/// </summary>
|
|
public record GetWithdrawalReportsQuery : IRequest<WithdrawalReportsDto>
|
|
{
|
|
/// <summary>
|
|
/// تاریخ شروع
|
|
/// </summary>
|
|
public DateTime? StartDate { get; init; }
|
|
|
|
/// <summary>
|
|
/// تاریخ پایان
|
|
/// </summary>
|
|
public DateTime? EndDate { get; init; }
|
|
|
|
/// <summary>
|
|
/// نوع بازه زمانی (روزانه، هفتگی، ماهانه)
|
|
/// </summary>
|
|
public ReportPeriodType PeriodType { get; init; } = ReportPeriodType.Daily;
|
|
|
|
/// <summary>
|
|
/// فیلتر بر اساس وضعیت
|
|
/// </summary>
|
|
public CommissionPayoutStatus? Status { get; init; }
|
|
|
|
/// <summary>
|
|
/// شناسه کاربر (برای فیلتر کردن بر اساس کاربر خاص)
|
|
/// </summary>
|
|
public long? UserId { get; init; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// نوع بازه زمانی گزارش
|
|
/// </summary>
|
|
public enum ReportPeriodType
|
|
{
|
|
Daily = 1,
|
|
Weekly = 2,
|
|
Monthly = 3
|
|
}
|
|
|
|
/// <summary>
|
|
/// DTO گزارش برداشتها
|
|
/// </summary>
|
|
public class WithdrawalReportsDto
|
|
{
|
|
/// <summary>
|
|
/// گزارشهای بازههای زمانی
|
|
/// </summary>
|
|
public List<PeriodReportDto> PeriodReports { get; set; } = new();
|
|
|
|
/// <summary>
|
|
/// خلاصه کلی
|
|
/// </summary>
|
|
public WithdrawalSummaryDto Summary { get; set; } = new();
|
|
}
|
|
|
|
/// <summary>
|
|
/// گزارش یک بازه زمانی
|
|
/// </summary>
|
|
public class PeriodReportDto
|
|
{
|
|
/// <summary>
|
|
/// عنوان بازه (مثلاً "هفته 1" یا "دی ماه")
|
|
/// </summary>
|
|
public string PeriodLabel { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// تاریخ شروع بازه
|
|
/// </summary>
|
|
public DateTime StartDate { get; set; }
|
|
|
|
/// <summary>
|
|
/// تاریخ پایان بازه
|
|
/// </summary>
|
|
public DateTime EndDate { get; set; }
|
|
|
|
/// <summary>
|
|
/// تعداد کل درخواستها
|
|
/// </summary>
|
|
public int TotalRequests { get; set; }
|
|
|
|
/// <summary>
|
|
/// تعداد درخواستهای در انتظار
|
|
/// </summary>
|
|
public int PendingCount { get; set; }
|
|
|
|
/// <summary>
|
|
/// تعداد درخواستهای تأیید شده
|
|
/// </summary>
|
|
public int ApprovedCount { get; set; }
|
|
|
|
/// <summary>
|
|
/// تعداد درخواستهای رد شده
|
|
/// </summary>
|
|
public int RejectedCount { get; set; }
|
|
|
|
/// <summary>
|
|
/// تعداد درخواستهای موفق
|
|
/// </summary>
|
|
public int CompletedCount { get; set; }
|
|
|
|
/// <summary>
|
|
/// تعداد درخواستهای ناموفق
|
|
/// </summary>
|
|
public int FailedCount { get; set; }
|
|
|
|
/// <summary>
|
|
/// مجموع مبلغ درخواستها
|
|
/// </summary>
|
|
public long TotalAmount { get; set; }
|
|
|
|
/// <summary>
|
|
/// مجموع مبلغ پرداخت شده
|
|
/// </summary>
|
|
public long PaidAmount { get; set; }
|
|
|
|
/// <summary>
|
|
/// مجموع مبلغ در انتظار
|
|
/// </summary>
|
|
public long PendingAmount { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// خلاصه کلی برداشتها
|
|
/// </summary>
|
|
public class WithdrawalSummaryDto
|
|
{
|
|
/// <summary>
|
|
/// تعداد کل درخواستها
|
|
/// </summary>
|
|
public int TotalRequests { get; set; }
|
|
|
|
/// <summary>
|
|
/// مجموع کل مبالغ
|
|
/// </summary>
|
|
public long TotalAmount { get; set; }
|
|
|
|
/// <summary>
|
|
/// مجموع مبلغ پرداخت شده
|
|
/// </summary>
|
|
public long TotalPaid { get; set; }
|
|
|
|
/// <summary>
|
|
/// مجموع مبلغ در انتظار
|
|
/// </summary>
|
|
public long TotalPending { get; set; }
|
|
|
|
/// <summary>
|
|
/// مجموع مبلغ رد شده
|
|
/// </summary>
|
|
public long TotalRejected { get; set; }
|
|
|
|
/// <summary>
|
|
/// میانگین مبلغ هر درخواست
|
|
/// </summary>
|
|
public long AverageAmount { get; set; }
|
|
|
|
/// <summary>
|
|
/// تعداد کاربران منحصر به فرد
|
|
/// </summary>
|
|
public int UniqueUsers { get; set; }
|
|
|
|
/// <summary>
|
|
/// درصد موفقیت (Completed / Total)
|
|
/// </summary>
|
|
public decimal SuccessRate { get; set; }
|
|
}
|