using CMSMicroservice.Protobuf.Protos.ManualPayment; using Microsoft.Extensions.Logging; namespace BackOffice.BFF.Application.ManualPaymentCQ.Commands.RejectManualPayment; public class RejectManualPaymentCommandHandler : IRequestHandler { private readonly IApplicationContractContext _context; private readonly ILogger _logger; public RejectManualPaymentCommandHandler( IApplicationContractContext context, ILogger logger) { _context = context; _logger = logger; } public async Task Handle(RejectManualPaymentCommand request, CancellationToken cancellationToken) { _logger.LogInformation("Rejecting manual payment via BFF. Id: {Id}", request.ManualPaymentId); var grpcRequest = new RejectManualPaymentRequest { ManualPaymentId = request.ManualPaymentId, RejectionReason = request.RejectionReason }; await _context.ManualPayments.RejectManualPaymentAsync(grpcRequest, cancellationToken: cancellationToken); return true; } }