feat: Implement Public Message management features including create, update, delete, and publish functionalities
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using BackOffice.BFF.Commission.Protobuf;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Commands.ProcessWithdrawal;
|
||||
|
||||
@@ -13,30 +14,21 @@ public class ProcessWithdrawalCommandHandler : IRequestHandler<ProcessWithdrawal
|
||||
|
||||
public async Task<ProcessWithdrawalResponseDto> Handle(ProcessWithdrawalCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
// TODO: Implement when CMS ProcessWithdrawal endpoint is ready
|
||||
await Task.CompletedTask;
|
||||
|
||||
var grpcRequest = new ProcessWithdrawalRequest
|
||||
{
|
||||
PayoutId = request.WithdrawalId,
|
||||
IsApproved = true,
|
||||
Reason = request.AdminNote != null
|
||||
? new StringValue { Value = request.AdminNote }
|
||||
: null
|
||||
};
|
||||
|
||||
await _context.Commissions.ProcessWithdrawalAsync(grpcRequest, cancellationToken: cancellationToken);
|
||||
|
||||
return new ProcessWithdrawalResponseDto
|
||||
{
|
||||
Success = true,
|
||||
Message = "Withdrawal processing pending CMS implementation"
|
||||
Message = "درخواست برداشت برای پرداخت ارسال شد"
|
||||
};
|
||||
|
||||
/* Uncomment when CMS endpoint is ready:
|
||||
var grpcRequest = new ProcessWithdrawalRequest
|
||||
{
|
||||
WithdrawalId = request.WithdrawalId,
|
||||
TransactionId = request.TransactionId ?? string.Empty,
|
||||
AdminNote = request.AdminNote ?? string.Empty
|
||||
};
|
||||
|
||||
var response = await _context.Commissions.ProcessWithdrawalAsync(grpcRequest, cancellationToken: cancellationToken);
|
||||
|
||||
return new ProcessWithdrawalResponseDto
|
||||
{
|
||||
Success = response.Success,
|
||||
Message = response.Message
|
||||
};
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user