feat: Implement Approve and Reject Withdrawal commands with handlers

This commit is contained in:
masoodafar-web
2025-12-01 16:48:07 +03:30
parent 8d31a8c026
commit 4aaf2247ff
27 changed files with 989 additions and 1 deletions
@@ -0,0 +1,37 @@
using CMSMicroservice.Application.Common.Interfaces;
namespace CMSMicroservice.Application.CommissionCQ.Queries.GetWorkerStatus;
public class GetWorkerStatusQueryHandler : IRequestHandler<GetWorkerStatusQuery, GetWorkerStatusResponseDto>
{
private readonly IApplicationDbContext _context;
public GetWorkerStatusQueryHandler(IApplicationDbContext context)
{
_context = context;
}
public async Task<GetWorkerStatusResponseDto> Handle(
GetWorkerStatusQuery request,
CancellationToken cancellationToken)
{
// TODO: این باید از یک service یا cache واقعی worker status را بگیرد
// فعلاً mock data برمی‌گرداند
await Task.CompletedTask;
return new GetWorkerStatusResponseDto
{
IsRunning = false,
IsEnabled = true,
CurrentExecutionId = null,
CurrentWeekNumber = null,
CurrentStep = "Idle",
LastRunAt = DateTime.UtcNow.AddHours(-24),
NextScheduledRun = DateTime.UtcNow.AddDays(7),
TotalExecutions = 48,
SuccessfulExecutions = 47,
FailedExecutions = 1
};
}
}