feat: add IsActive field to UserClubFeatures for admin management
This commit is contained in:
@@ -13,17 +13,12 @@ public record TriggerWeeklyCalculationCommand : IRequest<TriggerWeeklyCalculatio
|
||||
public bool ForceRecalculate { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Skip balance calculation
|
||||
/// Skip balance calculation (Step 1)
|
||||
/// </summary>
|
||||
public bool SkipBalances { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Skip pool calculation
|
||||
/// </summary>
|
||||
public bool SkipPool { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Skip payout processing
|
||||
/// Skip pool calculation and payout processing (Step 2)
|
||||
/// </summary>
|
||||
public bool SkipPayouts { get; init; }
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using CMSMicroservice.Application.Common.Interfaces;
|
||||
using CMSMicroservice.Application.CommissionCQ.Commands.CalculateWeeklyBalances;
|
||||
using CMSMicroservice.Application.CommissionCQ.Commands.CalculateWeeklyCommissionPool;
|
||||
using CMSMicroservice.Application.CommissionCQ.Commands.ProcessUserPayouts;
|
||||
|
||||
namespace CMSMicroservice.Application.CommissionCQ.Commands.TriggerWeeklyCalculation;
|
||||
|
||||
@@ -23,7 +22,7 @@ public class TriggerWeeklyCalculationCommandHandler : IRequestHandler<TriggerWee
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var executionId = Guid.NewGuid().ToString();
|
||||
var startedAt = DateTime.UtcNow;
|
||||
var startedAt = DateTime.Now;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -41,7 +40,7 @@ public class TriggerWeeklyCalculationCommandHandler : IRequestHandler<TriggerWee
|
||||
|
||||
var steps = new List<string>();
|
||||
|
||||
// Step 1: Calculate Weekly Balances
|
||||
// Step 1: Calculate Weekly Balances (تا 15 لول)
|
||||
if (!request.SkipBalances)
|
||||
{
|
||||
await _mediator.Send(new CalculateWeeklyBalancesCommand
|
||||
@@ -52,25 +51,15 @@ public class TriggerWeeklyCalculationCommandHandler : IRequestHandler<TriggerWee
|
||||
steps.Add("محاسبه امتیازات هفتگی");
|
||||
}
|
||||
|
||||
// Step 2: Calculate Weekly Commission Pool
|
||||
if (!request.SkipPool)
|
||||
// Step 2: Calculate Pool & Process Payouts (محاسبه استخر + پرداخت کاربران)
|
||||
if (!request.SkipPayouts)
|
||||
{
|
||||
await _mediator.Send(new CalculateWeeklyCommissionPoolCommand
|
||||
{
|
||||
WeekNumber = request.WeekNumber
|
||||
}, cancellationToken);
|
||||
steps.Add("محاسبه استخر کمیسیون");
|
||||
}
|
||||
|
||||
// Step 3: Process User Payouts
|
||||
if (!request.SkipPayouts)
|
||||
{
|
||||
await _mediator.Send(new ProcessUserPayoutsCommand
|
||||
{
|
||||
WeekNumber = request.WeekNumber,
|
||||
ForceReprocess = request.ForceRecalculate
|
||||
ForceRecalculate = request.ForceRecalculate
|
||||
}, cancellationToken);
|
||||
steps.Add("پردازش پرداختهای کاربران");
|
||||
steps.Add("محاسبه استخر و پرداخت کاربران");
|
||||
}
|
||||
|
||||
return new TriggerWeeklyCalculationResponseDto
|
||||
|
||||
Reference in New Issue
Block a user