feat: add manual membership payment processing with wallet and order management
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 7m8s

This commit is contained in:
masoodafar-web
2025-12-12 10:07:14 +03:30
parent b19cf5e32e
commit 094846ce8b
8 changed files with 309 additions and 1 deletions
@@ -3,6 +3,7 @@ using CMSMicroservice.WebApi.Common.Services;
using CMSMicroservice.Application.ManualPaymentCQ.Commands.CreateManualPayment;
using CMSMicroservice.Application.ManualPaymentCQ.Commands.ApproveManualPayment;
using CMSMicroservice.Application.ManualPaymentCQ.Commands.RejectManualPayment;
using CMSMicroservice.Application.ManualPaymentCQ.Commands.ProcessManualMembershipPayment;
using CMSMicroservice.Application.ManualPaymentCQ.Queries.GetAllManualPayments;
using Grpc.Core;
using Mapster;
@@ -56,4 +57,28 @@ public class ManualPaymentService : ManualPaymentContract.ManualPaymentContractB
{
return await _dispatchRequestToCQRS.Handle<GetAllManualPaymentsRequest, GetAllManualPaymentsQuery, GetAllManualPaymentsResponse>(request, context);
}
public override async Task<ProcessManualMembershipPaymentResponse> ProcessManualMembershipPayment(
ProcessManualMembershipPaymentRequest request,
ServerCallContext context)
{
var command = new ProcessManualMembershipPaymentCommand
{
UserId = request.UserId,
Amount = request.Amount,
ReferenceNumber = request.ReferenceNumber,
Description = request.Description,
AdminUserId = request.AdminUserId
};
var result = await _sender.Send(command, context.CancellationToken);
return new ProcessManualMembershipPaymentResponse
{
TransactionId = result.TransactionId,
OrderId = result.OrderId,
NewWalletBalance = result.NewWalletBalance,
Message = result.Message
};
}
}