update
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetWorkerStatus;
|
||||
|
||||
public class GetWorkerStatusQuery : IRequest<GetWorkerStatusResponseDto>
|
||||
{
|
||||
// No parameters needed - returns current worker status
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
using BackOffice.BFF.Commission.Protobuf;
|
||||
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetWorkerStatus;
|
||||
|
||||
public class GetWorkerStatusQueryHandler : IRequestHandler<GetWorkerStatusQuery, GetWorkerStatusResponseDto>
|
||||
{
|
||||
private readonly IApplicationContractContext _context;
|
||||
|
||||
public GetWorkerStatusQueryHandler(IApplicationContractContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public async Task<GetWorkerStatusResponseDto> Handle(GetWorkerStatusQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
var grpcRequest = new GetWorkerStatusRequest();
|
||||
|
||||
var response = await _context.Commissions.GetWorkerStatusAsync(grpcRequest, cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<GetWorkerStatusResponseDto>();
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetWorkerStatus;
|
||||
|
||||
public class GetWorkerStatusResponseDto
|
||||
{
|
||||
public bool IsRunning { get; set; }
|
||||
public bool IsEnabled { get; set; }
|
||||
public string? CurrentExecutionId { get; set; }
|
||||
public string? CurrentWeekNumber { get; set; }
|
||||
public string? CurrentStep { get; set; }
|
||||
public DateTime? LastRunAt { get; set; }
|
||||
public DateTime? NextScheduledRun { get; set; }
|
||||
public int TotalExecutions { get; set; }
|
||||
public int SuccessfulExecutions { get; set; }
|
||||
public int FailedExecutions { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user