feat(order): refactor order data mapping for improved clarity and structure
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 13m4s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 13m4s
- Updated GetAllDiscountOrdersQueryHandler to enhance order data mapping by using a more structured approach with AdminOrderDto. - Refactored user full name construction in GetCustomerOrderQueryHandler and GetCustomerOrdersQueryHandler to utilize UserDisplayName for better readability. - Added necessary using directives for consistency across query handlers.
This commit is contained in:
+2
-1
@@ -1,3 +1,4 @@
|
||||
using CMSMicroservice.Application.Common;
|
||||
using CMSMicroservice.Application.Common.Exceptions;
|
||||
using CMSMicroservice.Application.Common.Interfaces;
|
||||
using CMSMicroservice.Domain.Entities;
|
||||
@@ -50,7 +51,7 @@ public class GetCustomerOrderQueryHandler : IRequestHandler<GetCustomerOrderQuer
|
||||
DeliveryStatus = order.DeliveryStatus,
|
||||
TrackingCode = order.TrackingCode ?? "",
|
||||
DeliveryDescription = order.DeliveryDescription ?? "",
|
||||
UserFullName = $"{order.User?.FirstName ?? ""} {order.User?.LastName ?? ""}".Trim(),
|
||||
UserFullName = UserDisplayName.From(order.User),
|
||||
UserNationalCode = order.User?.NationalCode ?? "",
|
||||
PostalCode = order.UserAddress?.PostalCode ?? "",
|
||||
UserMobile = order.User?.Mobile ?? "",
|
||||
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
using CMSMicroservice.Application.Common;
|
||||
using CMSMicroservice.Application.Common.Extensions;
|
||||
using CMSMicroservice.Application.Common.Interfaces;
|
||||
using CMSMicroservice.Application.Common.Models;
|
||||
@@ -72,7 +73,7 @@ public class GetCustomerOrdersQueryHandler : IRequestHandler<GetCustomerOrdersQu
|
||||
DeliveryStatus = order.DeliveryStatus,
|
||||
TrackingCode = order.TrackingCode ?? "",
|
||||
DeliveryDescription = order.DeliveryDescription ?? "",
|
||||
UserFullName = $"{order.User?.FirstName ?? ""} {order.User?.LastName ?? ""}".Trim(),
|
||||
UserFullName = UserDisplayName.From(order.User),
|
||||
UserNationalCode = order.User?.NationalCode ?? "",
|
||||
VatAmount = order.OrderVAT?.VATAmount ?? 0,
|
||||
VatPercentage = order.OrderVAT != null ? (double)order.OrderVAT.VATRate * 100 : 0,
|
||||
|
||||
Reference in New Issue
Block a user