Added 5 Commands and 4 Queries for commission calculation and payout system: Commands: - CalculateWeeklyBalances: Recursive binary tree traversal for leg balances - CalculateWeeklyCommissionPool: Calculate ValuePerBalance from total pool - ProcessUserPayouts: Distribute commission to users, create payout records - RequestWithdrawal: User requests cash/diamond withdrawal - ProcessWithdrawal: Admin approves/rejects withdrawal Queries: - GetWeeklyCommissionPool: Retrieve pool details - GetUserCommissionPayouts: List payouts with filters (status, week, user) - GetCommissionPayoutHistory: Complete audit trail - GetUserWeeklyBalances: Show leg balances and contributions Total: 35 files, ~1,100 lines of code Binary tree algorithm, state machine, withdrawal system implemented
23 lines
596 B
C#
23 lines
596 B
C#
namespace CMSMicroservice.Application.CommissionCQ.Commands.ProcessWithdrawal;
|
|
|
|
/// <summary>
|
|
/// Command برای پردازش برداشت (توسط Admin)
|
|
/// </summary>
|
|
public record ProcessWithdrawalCommand : IRequest<Unit>
|
|
{
|
|
/// <summary>
|
|
/// شناسه پرداخت کمیسیون
|
|
/// </summary>
|
|
public long PayoutId { get; init; }
|
|
|
|
/// <summary>
|
|
/// آیا تایید شده است؟
|
|
/// </summary>
|
|
public bool IsApproved { get; init; }
|
|
|
|
/// <summary>
|
|
/// دلیل (در صورت رد)
|
|
/// </summary>
|
|
public string? Reason { get; init; }
|
|
}
|