feat: add Mapster profiles and enable DiscountOrder handlers
All checks were successful
Build and Deploy / build (push) Successful in 2m14s
All checks were successful
Build and Deploy / build (push) Successful in 2m14s
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using BackOffice.BFF.Application.Common.Interfaces;
|
||||
using CMSMicroservice.Protobuf.Protos.ManualPayment;
|
||||
using BackOffice.BFF.ManualPayment.Protobuf;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using MediatR;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -30,7 +30,7 @@ public class ApproveManualPaymentCommandHandler : IRequestHandler<ApproveManualP
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(request.ApprovalNote))
|
||||
{
|
||||
grpcRequest.ApprovalNote = new StringValue { Value = request.ApprovalNote };
|
||||
grpcRequest.ApprovalNote = request.ApprovalNote;
|
||||
}
|
||||
|
||||
await _context.ManualPayments.ApproveManualPaymentAsync(grpcRequest, cancellationToken: cancellationToken);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using BackOffice.BFF.Application.Common.Interfaces;
|
||||
using CMSMicroservice.Protobuf.Protos.ManualPayment;
|
||||
using BackOffice.BFF.ManualPayment.Protobuf;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using MediatR;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -31,13 +31,13 @@ public class CreateManualPaymentCommandHandler : IRequestHandler<CreateManualPay
|
||||
{
|
||||
UserId = request.UserId,
|
||||
Amount = request.Amount,
|
||||
Type = (ManualPaymentType)request.Type,
|
||||
Type = request.Type,
|
||||
Description = request.Description
|
||||
};
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(request.ReferenceNumber))
|
||||
{
|
||||
grpcRequest.ReferenceNumber = new StringValue { Value = request.ReferenceNumber };
|
||||
grpcRequest.ReferenceNumber = request.ReferenceNumber;
|
||||
}
|
||||
|
||||
var response = await _context.ManualPayments.CreateManualPaymentAsync(grpcRequest, cancellationToken: cancellationToken);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using BackOffice.BFF.Application.Common.Interfaces;
|
||||
using CMSMicroservice.Protobuf.Protos.ManualPayment;
|
||||
using BackOffice.BFF.ManualPayment.Protobuf;
|
||||
using MediatR;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using BackOffice.BFF.Application.Common.Interfaces;
|
||||
using BackOffice.BFF.Application.Common.Models;
|
||||
using CMSMicroservice.Protobuf.Protos.ManualPayment;
|
||||
using BackOffice.BFF.ManualPayment.Protobuf;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using MediatR;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -29,35 +29,16 @@ public class GetManualPaymentsQueryHandler : IRequestHandler<GetManualPaymentsQu
|
||||
request.Status,
|
||||
request.Type);
|
||||
|
||||
var grpcRequest = new GetAllManualPaymentsRequest
|
||||
var grpcRequest = new GetManualPaymentsRequest
|
||||
{
|
||||
PageNumber = request.PageNumber,
|
||||
PageSize = request.PageSize
|
||||
PageSize = request.PageSize,
|
||||
UserId = request.UserId,
|
||||
Status = request.Status,
|
||||
Type = request.Type
|
||||
};
|
||||
|
||||
if (request.UserId.HasValue)
|
||||
{
|
||||
grpcRequest.UserId = new Int64Value { Value = request.UserId.Value };
|
||||
}
|
||||
|
||||
if (request.Status.HasValue)
|
||||
{
|
||||
grpcRequest.Status = new Int32Value { Value = request.Status.Value };
|
||||
}
|
||||
|
||||
if (request.Type.HasValue)
|
||||
{
|
||||
grpcRequest.Type = new Int32Value { Value = request.Type.Value };
|
||||
}
|
||||
|
||||
if (request.RequestedBy.HasValue)
|
||||
{
|
||||
grpcRequest.RequestedBy = new Int64Value { Value = request.RequestedBy.Value };
|
||||
}
|
||||
|
||||
grpcRequest.OrderByDescending = new BoolValue { Value = request.OrderByDescending };
|
||||
|
||||
var response = await _context.ManualPayments.GetAllManualPaymentsAsync(grpcRequest, cancellationToken: cancellationToken);
|
||||
var response = await _context.ManualPayments.GetManualPaymentsAsync(grpcRequest, cancellationToken: cancellationToken);
|
||||
|
||||
var meta = response.MetaData;
|
||||
|
||||
@@ -69,20 +50,20 @@ public class GetManualPaymentsQueryHandler : IRequestHandler<GetManualPaymentsQu
|
||||
UserFullName = m.UserFullName,
|
||||
UserMobile = m.UserMobile,
|
||||
Amount = m.Amount,
|
||||
Type = (int)m.Type,
|
||||
Type = m.Type,
|
||||
TypeDisplay = m.TypeDisplay,
|
||||
Description = m.Description,
|
||||
ReferenceNumber = m.ReferenceNumber,
|
||||
Status = (int)m.Status,
|
||||
Status = m.Status,
|
||||
StatusDisplay = m.StatusDisplay,
|
||||
RequestedBy = m.RequestedBy,
|
||||
RequestedByName = m.RequestedByName,
|
||||
ApprovedBy = m.ApprovedBy?.Value,
|
||||
ApprovedBy = m.ApprovedBy,
|
||||
ApprovedByName = m.ApprovedByName,
|
||||
ApprovedAt = m.ApprovedAt?.ToDateTime(),
|
||||
RejectionReason = m.RejectionReason,
|
||||
TransactionId = m.TransactionId?.Value,
|
||||
Created = m.Created.ToDateTime()
|
||||
TransactionId = m.TransactionId,
|
||||
Created = m.Created?.ToDateTime() ?? DateTime.UtcNow
|
||||
})
|
||||
.ToList()
|
||||
?? new List<ManualPaymentModel>();
|
||||
|
||||
Reference in New Issue
Block a user