feat: Implement Public Message management features including create, update, delete, and publish functionalities

This commit is contained in:
masoodafar-web
2025-12-04 17:29:05 +03:30
parent 64b6f34185
commit 82319285bc
19 changed files with 550 additions and 98 deletions

View File

@@ -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
};
*/
}
}