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
24 lines
894 B
C#
24 lines
894 B
C#
namespace CMSMicroservice.Application.CommissionCQ.Queries.GetCommissionPayoutHistory;
|
|
|
|
public class GetCommissionPayoutHistoryResponseDto
|
|
{
|
|
public MetaData MetaData { get; set; }
|
|
public List<GetCommissionPayoutHistoryResponseModel> Models { get; set; }
|
|
}
|
|
|
|
public class GetCommissionPayoutHistoryResponseModel
|
|
{
|
|
public long Id { get; set; }
|
|
public long UserCommissionPayoutId { get; set; }
|
|
public long UserId { get; set; }
|
|
public string WeekNumber { get; set; } = string.Empty;
|
|
public long AmountBefore { get; set; }
|
|
public long AmountAfter { get; set; }
|
|
public CommissionPayoutStatus? OldStatus { get; set; }
|
|
public CommissionPayoutStatus NewStatus { get; set; }
|
|
public CommissionPayoutAction Action { get; set; }
|
|
public string? PerformedBy { get; set; }
|
|
public string? Reason { get; set; }
|
|
public DateTimeOffset Created { get; set; }
|
|
}
|