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:
59
src/BackOffice.BFF.WebApi/Common/Mappings/CategoryProfile.cs
Normal file
59
src/BackOffice.BFF.WebApi/Common/Mappings/CategoryProfile.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using BackOffice.BFF.Application.CategoryCQ.Queries.GetAllCategoryByFilter;
|
||||
using BackOffice.BFF.Application.CategoryCQ.Queries.GetCategory;
|
||||
using BackOffice.BFF.Application.CategoryCQ.Commands.CreateNewCategory;
|
||||
using BackOffice.BFF.Category.Protobuf.Protos.Category;
|
||||
using BackOffice.BFF.Protobuf.Common;
|
||||
|
||||
namespace BackOffice.BFF.WebApi.Common.Mappings;
|
||||
|
||||
public class CategoryProfile : IRegister
|
||||
{
|
||||
void IRegister.Register(TypeAdapterConfig config)
|
||||
{
|
||||
// GetAllCategoryByFilterResponseDto -> GetAllCategoryByFilterResponse
|
||||
// config.NewConfig<GetAllCategoryByFilterResponseDto, GetAllCategoryByFilterResponse>()
|
||||
// .MapWith(src => new GetAllCategoryByFilterResponse
|
||||
// {
|
||||
// MetaData = new MetaData
|
||||
// {
|
||||
// CurrentPage = src.MetaData.PageNumber,
|
||||
// PageSize = src.MetaData.PageSize,
|
||||
// TotalCount = src.MetaData.TotalCount,
|
||||
// TotalPage = (int)Math.Ceiling((double)src.MetaData.TotalCount / src.MetaData.PageSize)
|
||||
// },
|
||||
// Models = { (src.Models ?? Enumerable.Empty<GetAllCategoryByFilterResponseModel>())
|
||||
// .Select(m => new GetAllCategoryByFilterResponseModel
|
||||
// {
|
||||
// Id = m.Id,
|
||||
// Name = m.Name ?? string.Empty,
|
||||
// Title = m.Title ?? string.Empty,
|
||||
// Description = m.Description ?? string.Empty,
|
||||
// ImagePath = m.ImagePath ?? string.Empty,
|
||||
// ParentId = m.ParentId ?? 0,
|
||||
// IsActive = m.IsActive,
|
||||
// SortOrder = m.SortOrder
|
||||
// }) }
|
||||
// });
|
||||
|
||||
// GetCategoryResponseDto -> GetCategoryResponse
|
||||
config.NewConfig<GetCategoryResponseDto, GetCategoryResponse>()
|
||||
.MapWith(src => new GetCategoryResponse
|
||||
{
|
||||
Id = src.Id,
|
||||
Name = src.Name ?? string.Empty,
|
||||
Title = src.Title ?? string.Empty,
|
||||
Description = src.Description ?? string.Empty,
|
||||
ImagePath = src.ImagePath ?? string.Empty,
|
||||
ParentId = src.ParentId ?? 0,
|
||||
IsActive = src.IsActive,
|
||||
SortOrder = src.SortOrder
|
||||
});
|
||||
|
||||
// CreateNewCategoryResponseDto -> CreateNewCategoryResponse
|
||||
config.NewConfig<CreateNewCategoryResponseDto, CreateNewCategoryResponse>()
|
||||
.MapWith(src => new CreateNewCategoryResponse
|
||||
{
|
||||
Id = src.Id
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using BackOffice.BFF.Application.ClubMembershipCQ.Queries.GetAllClubMembers;
|
||||
using Foursat.BackOffice.BFF.ClubMembership.Protos;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
namespace BackOffice.BFF.WebApi.Common.Mappings;
|
||||
|
||||
public class ClubMembershipProfile : IRegister
|
||||
{
|
||||
void IRegister.Register(TypeAdapterConfig config)
|
||||
{
|
||||
// GetAllClubMembersResponseDto -> GetAllClubMembershipsResponse
|
||||
// config.NewConfig<GetAllClubMembersResponseDto, GetAllClubMembershipsResponse>()
|
||||
// .MapWith(src => new GetAllClubMembershipsResponse
|
||||
// {
|
||||
// Members = { src.Members.Select(m => new ClubMemberModel
|
||||
// {
|
||||
// Id = m.Id,
|
||||
// UserId = m.UserId,
|
||||
// UserName = m.UserName ?? string.Empty,
|
||||
// ActivationDate = Timestamp.FromDateTime(DateTime.SpecifyKind(m.ActivationDate, DateTimeKind.Utc)),
|
||||
// InitialContribution = m.InitialContribution,
|
||||
// CurrentBalance = m.CurrentBalance,
|
||||
// TotalEarnings = m.TotalEarnings,
|
||||
// IsActive = m.IsActive,
|
||||
// ClubLevel = m.ClubLevel,
|
||||
// ClubLevelDisplay = m.ClubLevelDisplay ?? string.Empty
|
||||
// }) },
|
||||
// TotalCount = src.TotalCount,
|
||||
// PageNumber = src.PageNumber,
|
||||
// PageSize = src.PageSize
|
||||
// });
|
||||
}
|
||||
}
|
||||
172
src/BackOffice.BFF.WebApi/Common/Mappings/CommissionProfile.cs
Normal file
172
src/BackOffice.BFF.WebApi/Common/Mappings/CommissionProfile.cs
Normal file
@@ -0,0 +1,172 @@
|
||||
using BackOffice.BFF.Application.CommissionCQ.Queries.GetWeeklyPool;
|
||||
using BackOffice.BFF.Application.CommissionCQ.Queries.GetUserPayouts;
|
||||
using BackOffice.BFF.Application.CommissionCQ.Queries.GetAllWeeklyPools;
|
||||
using BackOffice.BFF.Application.CommissionCQ.Queries.GetUserWeeklyBalances;
|
||||
using BackOffice.BFF.Application.CommissionCQ.Queries.GetWithdrawalRequests;
|
||||
using BackOffice.BFF.Application.CommissionCQ.Queries.GetWithdrawalReports;
|
||||
using Foursat.BackOffice.BFF.Commission.Protos;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using BackOffice.BFF.Protobuf.Common;
|
||||
|
||||
namespace BackOffice.BFF.WebApi.Common.Mappings;
|
||||
|
||||
public class CommissionProfile : IRegister
|
||||
{
|
||||
void IRegister.Register(TypeAdapterConfig config)
|
||||
{
|
||||
// GetWeeklyPoolResponseDto -> GetWeeklyCommissionPoolResponse
|
||||
config.NewConfig<GetWeeklyPoolResponseDto, GetWeeklyCommissionPoolResponse>()
|
||||
.MapWith(src => new GetWeeklyCommissionPoolResponse
|
||||
{
|
||||
Id = src.Id,
|
||||
WeekNumber = src.WeekNumber ?? string.Empty,
|
||||
// TotalPoolValue = src.TotalPoolValue,
|
||||
// TotalContributions = src.TotalContributions,
|
||||
// TotalPayouts = src.TotalPayouts,
|
||||
// LeftBalance = src.LeftBalance,
|
||||
// ActiveMembersCount = src.ActiveMembersCount,
|
||||
IsCalculated = src.IsCalculated,
|
||||
CalculatedAt = src.CalculatedAt.HasValue
|
||||
? Timestamp.FromDateTime(DateTime.SpecifyKind(src.CalculatedAt.Value, DateTimeKind.Utc))
|
||||
: null,
|
||||
Created = Timestamp.FromDateTime(DateTime.SpecifyKind(src.CreatedAt, DateTimeKind.Utc))
|
||||
});
|
||||
|
||||
// GetUserPayoutsResponseDto -> GetUserCommissionPayoutsResponse
|
||||
// config.NewConfig<GetUserPayoutsResponseDto, GetUserCommissionPayoutsResponse>()
|
||||
// .MapWith(src => new GetUserCommissionPayoutsResponse
|
||||
// {
|
||||
// MetaData = new BackOffice.BFF.Protobuf.Common.MetaData
|
||||
// {
|
||||
// CurrentPage = src.PageNumber,
|
||||
// PageSize = src.PageSize,
|
||||
// TotalCount = src.TotalCount,
|
||||
// TotalPage = src.TotalPages
|
||||
// },
|
||||
// Models = { src.Payouts.Select(m => new UserCommissionPayoutModel
|
||||
// {
|
||||
// Id = m.Id,
|
||||
// UserId = m.UserId,
|
||||
// UserName = m.UserName ?? string.Empty,
|
||||
// WeekNumber = m.WeekNumber ?? string.Empty,
|
||||
// BalanceCount = m.BalanceCount,
|
||||
// PayoutAmount = m.PayoutAmount,
|
||||
// Status = m.Status,
|
||||
// StatusDisplay = m.StatusDisplay ?? string.Empty,
|
||||
// PayoutDate = m.PayoutDate.HasValue
|
||||
// ? Timestamp.FromDateTime(DateTime.SpecifyKind(m.PayoutDate.Value, DateTimeKind.Utc))
|
||||
// : null,
|
||||
// Created = Timestamp.FromDateTime(DateTime.SpecifyKind(m.Created, DateTimeKind.Utc))
|
||||
// }) }
|
||||
// });
|
||||
|
||||
// GetAllWeeklyPoolsResponseDto -> GetAllWeeklyPoolsResponse
|
||||
config.NewConfig<GetAllWeeklyPoolsResponseDto, GetAllWeeklyPoolsResponse>()
|
||||
.MapWith(src => new GetAllWeeklyPoolsResponse
|
||||
{
|
||||
MetaData = new BackOffice.BFF.Protobuf.Common.MetaData
|
||||
{
|
||||
CurrentPage = src.MetaData.CurrentPage,
|
||||
PageSize = src.MetaData.PageSize,
|
||||
TotalCount = src.MetaData.TotalCount,
|
||||
TotalPage = src.MetaData.TotalPages
|
||||
},
|
||||
Models = { src.Models.Select(m => new WeeklyCommissionPoolModel
|
||||
{
|
||||
Id = m.Id,
|
||||
WeekNumber = m.WeekNumber ?? string.Empty,
|
||||
TotalPoolAmount = m.TotalPoolAmount,
|
||||
TotalBalances = m.TotalBalances,
|
||||
ValuePerBalance = m.ValuePerBalance,
|
||||
IsCalculated = m.IsCalculated,
|
||||
CalculatedAt = m.CalculatedAt.HasValue
|
||||
? Timestamp.FromDateTime(DateTime.SpecifyKind(m.CalculatedAt.Value, DateTimeKind.Utc))
|
||||
: null,
|
||||
Created = Timestamp.FromDateTime(DateTime.SpecifyKind(m.Created, DateTimeKind.Utc))
|
||||
}) }
|
||||
});
|
||||
|
||||
// GetUserWeeklyBalancesResponseDto -> GetUserWeeklyBalancesResponse
|
||||
config.NewConfig<GetUserWeeklyBalancesResponseDto, GetUserWeeklyBalancesResponse>()
|
||||
.MapWith(src => new GetUserWeeklyBalancesResponse
|
||||
{
|
||||
MetaData = new BackOffice.BFF.Protobuf.Common.MetaData
|
||||
{
|
||||
CurrentPage = src.MetaData.CurrentPage,
|
||||
PageSize = src.MetaData.PageSize,
|
||||
TotalCount = src.MetaData.TotalCount,
|
||||
TotalPage = src.MetaData.TotalPages
|
||||
},
|
||||
Models = { src.Models.Select(m => new UserWeeklyBalanceModel
|
||||
{
|
||||
Id = m.Id,
|
||||
UserId = m.UserId,
|
||||
WeekNumber = m.WeekNumber ?? string.Empty,
|
||||
LeftLegBalances = m.LeftLegBalances,
|
||||
RightLegBalances = m.RightLegBalances,
|
||||
TotalBalances = m.TotalBalances,
|
||||
WeeklyPoolContribution = m.WeeklyPoolContribution,
|
||||
CalculatedAt = m.CalculatedAt.HasValue
|
||||
? Timestamp.FromDateTime(DateTime.SpecifyKind(m.CalculatedAt.Value, DateTimeKind.Utc))
|
||||
: null,
|
||||
IsExpired = m.IsExpired,
|
||||
Created = Timestamp.FromDateTime(DateTime.SpecifyKind(m.Created, DateTimeKind.Utc))
|
||||
}) }
|
||||
});
|
||||
|
||||
// GetWithdrawalRequestsResponseDto -> GetWithdrawalRequestsResponse
|
||||
// config.NewConfig<GetWithdrawalRequestsResponseDto, GetWithdrawalRequestsResponse>()
|
||||
// .MapWith(src => new GetWithdrawalRequestsResponse
|
||||
// {
|
||||
// MetaData = new BackOffice.BFF.Protobuf.Common.MetaData
|
||||
// {
|
||||
// CurrentPage = src.MetaData.CurrentPage,
|
||||
// PageSize = src.MetaData.PageSize,
|
||||
// TotalCount = src.MetaData.TotalCount,
|
||||
// TotalPage = src.MetaData.TotalPages
|
||||
// },
|
||||
// Models = { src.Models.Select(m => new WithdrawalRequestModel
|
||||
// {
|
||||
// Id = m.Id,
|
||||
// UserId = m.UserId,
|
||||
// UserName = m.UserName ?? string.Empty,
|
||||
// Amount = m.Amount,
|
||||
// Status = m.Status,
|
||||
// StatusDisplay = m.StatusDisplay ?? string.Empty,
|
||||
// RequestedAt = Timestamp.FromDateTime(DateTime.SpecifyKind(m.RequestedAt, DateTimeKind.Utc)),
|
||||
// ProcessedAt = m.ProcessedAt.HasValue
|
||||
// ? Timestamp.FromDateTime(DateTime.SpecifyKind(m.ProcessedAt.Value, DateTimeKind.Utc))
|
||||
// : null,
|
||||
// ProcessedBy = m.ProcessedBy,
|
||||
// ProcessedByName = m.ProcessedByName ?? string.Empty,
|
||||
// RejectionReason = m.RejectionReason ?? string.Empty
|
||||
// }) }
|
||||
// });
|
||||
|
||||
// GetWithdrawalReportsResponseDto -> GetWithdrawalReportsResponse
|
||||
// config.NewConfig<GetWithdrawalReportsResponseDto, GetWithdrawalReportsResponse>()
|
||||
// .MapWith(src => new GetWithdrawalReportsResponse
|
||||
// {
|
||||
// TotalRequests = src.TotalRequests,
|
||||
// PendingCount = src.PendingCount,
|
||||
// ApprovedCount = src.ApprovedCount,
|
||||
// RejectedCount = src.RejectedCount,
|
||||
// ProcessedCount = src.ProcessedCount,
|
||||
// TotalAmount = src.TotalAmount,
|
||||
// PendingAmount = src.PendingAmount,
|
||||
// ApprovedAmount = src.ApprovedAmount,
|
||||
// ProcessedAmount = src.ProcessedAmount,
|
||||
// Reports = { src.Reports.Select(r => new WithdrawalReportModel
|
||||
// {
|
||||
// UserId = r.UserId,
|
||||
// UserName = r.UserName ?? string.Empty,
|
||||
// TotalRequests = r.TotalRequests,
|
||||
// TotalAmount = r.TotalAmount,
|
||||
// ApprovedAmount = r.ApprovedAmount,
|
||||
// LastRequestDate = r.LastRequestDate.HasValue
|
||||
// ? Timestamp.FromDateTime(DateTime.SpecifyKind(r.LastRequestDate.Value, DateTimeKind.Utc))
|
||||
// : null
|
||||
// }) }
|
||||
// });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using BackOffice.BFF.Application.ConfigurationCQ.Queries.GetAllConfigurations;
|
||||
using Foursat.BackOffice.BFF.Configuration.Protos;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using BackOffice.BFF.Protobuf.Common;
|
||||
|
||||
namespace BackOffice.BFF.WebApi.Common.Mappings;
|
||||
|
||||
public class ConfigurationProfile : IRegister
|
||||
{
|
||||
void IRegister.Register(TypeAdapterConfig config)
|
||||
{
|
||||
// GetAllConfigurationsResponseDto -> GetAllConfigurationsResponse
|
||||
config.NewConfig<GetAllConfigurationsResponseDto, GetAllConfigurationsResponse>()
|
||||
.MapWith(src => new GetAllConfigurationsResponse
|
||||
{
|
||||
MetaData = new BackOffice.BFF.Protobuf.Common.MetaData
|
||||
{
|
||||
CurrentPage = src.MetaData.CurrentPage,
|
||||
PageSize = src.MetaData.PageSize,
|
||||
TotalCount = src.MetaData.TotalCount,
|
||||
TotalPage = src.MetaData.TotalPages
|
||||
},
|
||||
Models = { src.Models.Select(m => new ConfigurationModel
|
||||
{
|
||||
Id = m.Id,
|
||||
Key = m.Key ?? string.Empty,
|
||||
Value = m.Value ?? string.Empty,
|
||||
Description = m.Description ?? string.Empty,
|
||||
Scope = m.Scope,
|
||||
// ScopeDisplay = m.ScopeDisplay ?? string.Empty,
|
||||
IsActive = m.IsActive,
|
||||
Created = Timestamp.FromDateTime(DateTime.SpecifyKind(m.Created, DateTimeKind.Utc))
|
||||
}) }
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
using Mapster;
|
||||
using BackOffice.BFF.Application.DiscountOrderCQ.Commands.PlaceOrder;
|
||||
using BackOffice.BFF.Application.DiscountOrderCQ.Commands.CompleteOrderPayment;
|
||||
using BackOffice.BFF.Application.DiscountOrderCQ.Commands.UpdateOrderStatus;
|
||||
using BackOffice.BFF.Application.DiscountOrderCQ.Queries.GetOrderById;
|
||||
using BackOffice.BFF.Application.DiscountOrderCQ.Queries.GetUserOrders;
|
||||
using BackOffice.BFF.DiscountOrder.Protobuf.Protos.DiscountOrder;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
namespace BackOffice.BFF.WebApi.Common.Mappings;
|
||||
|
||||
public class DiscountOrderProfile : IRegister
|
||||
{
|
||||
void IRegister.Register(TypeAdapterConfig config)
|
||||
{
|
||||
// ========== PlaceOrder Mappings ==========
|
||||
|
||||
// Command → BFF Proto Request
|
||||
config.NewConfig<PlaceOrderCommand, PlaceOrderRequest>()
|
||||
.MapWith(src => new PlaceOrderRequest
|
||||
{
|
||||
UserId = src.UserId,
|
||||
UserAddressId = src.AddressId,
|
||||
DiscountBalanceToUse = src.DiscountBalanceAmount,
|
||||
Notes = src.Notes // Protobuf compiler handles string to StringValue conversion
|
||||
});
|
||||
|
||||
// BFF Proto Response → DTO
|
||||
config.NewConfig<PlaceOrderResponse, PlaceOrderResponseDto>()
|
||||
.MapWith(src => new PlaceOrderResponseDto
|
||||
{
|
||||
OrderId = src.OrderId,
|
||||
TrackingCode = src.OrderId.ToString(), // Use OrderId as tracking code
|
||||
RequiresGatewayPayment = src.GatewayAmount > 0,
|
||||
GatewayPayableAmount = src.GatewayAmount
|
||||
});
|
||||
|
||||
// ========== CompleteOrderPayment Mappings ==========
|
||||
|
||||
// Command → BFF Proto Request
|
||||
config.NewConfig<CompleteOrderPaymentCommand, CompleteOrderPaymentRequest>()
|
||||
.MapWith(src => new CompleteOrderPaymentRequest
|
||||
{
|
||||
OrderId = src.OrderId,
|
||||
TransactionId = src.PaymentTransactionCode, // Protobuf compiler handles string to StringValue
|
||||
PaymentSuccess = src.PaymentSuccess
|
||||
});
|
||||
|
||||
// BFF Proto Response → DTO
|
||||
config.NewConfig<CompleteOrderPaymentResponse, CompleteOrderPaymentResponseDto>()
|
||||
.MapWith(src => new CompleteOrderPaymentResponseDto
|
||||
{
|
||||
Success = src.Success,
|
||||
Message = src.Message
|
||||
});
|
||||
|
||||
// ========== UpdateOrderStatus Mappings ==========
|
||||
|
||||
// Command → BFF Proto Request
|
||||
config.NewConfig<UpdateOrderStatusCommand, UpdateOrderStatusRequest>()
|
||||
.MapWith(src => new UpdateOrderStatusRequest
|
||||
{
|
||||
OrderId = src.OrderId,
|
||||
DeliveryStatus = (DeliveryStatus)src.NewStatus,
|
||||
TrackingCode = src.TrackingCode, // Protobuf compiler handles string to StringValue
|
||||
AdminNotes = src.AdminNote // Protobuf compiler handles string to StringValue
|
||||
});
|
||||
|
||||
// BFF Proto Response → DTO
|
||||
config.NewConfig<UpdateOrderStatusResponse, UpdateOrderStatusResponseDto>()
|
||||
.MapWith(src => new UpdateOrderStatusResponseDto
|
||||
{
|
||||
Success = src.Success,
|
||||
Message = src.Message
|
||||
});
|
||||
|
||||
// ========== GetOrderById Mappings ==========
|
||||
|
||||
// BFF Proto Response → DTO
|
||||
config.NewConfig<GetOrderByIdResponse, GetOrderByIdResponseDto>()
|
||||
.MapWith(src => new GetOrderByIdResponseDto
|
||||
{
|
||||
Id = src.Id,
|
||||
UserId = src.UserId,
|
||||
TrackingCode = src.TrackingCode ?? src.OrderNumber,
|
||||
Status = (int)src.DeliveryStatus,
|
||||
StatusTitle = GetDeliveryStatusTitle(src.DeliveryStatus),
|
||||
TotalPrice = src.TotalPrice,
|
||||
DiscountBalanceUsed = src.DiscountBalanceUsed,
|
||||
GatewayPayment = src.GatewayAmount,
|
||||
FinalPrice = src.TotalPrice - src.DiscountBalanceUsed,
|
||||
PaymentTransactionCode = src.TransactionId ?? string.Empty,
|
||||
AdminNote = src.AdminNotes ?? string.Empty,
|
||||
CreatedAt = src.Created != null ? src.Created.ToDateTime() : DateTime.UtcNow,
|
||||
PaidAt = src.PaymentCompleted && src.Created != null ? src.Created.ToDateTime() : (DateTime?)null,
|
||||
ShippingAddress = src.Address != null ? new AddressInfoDto
|
||||
{
|
||||
Id = src.Address.Id,
|
||||
RecipientName = src.Address.Title,
|
||||
RecipientPhone = src.Address.Phone ?? string.Empty,
|
||||
Province = ExtractProvince(src.Address.Address),
|
||||
City = ExtractCity(src.Address.Address),
|
||||
PostalCode = src.Address.PostalCode,
|
||||
FullAddress = src.Address.Address
|
||||
} : null,
|
||||
Items = src.Items.Select(item => new Application.DiscountOrderCQ.Queries.GetOrderById.OrderItemDto
|
||||
{
|
||||
Id = item.ProductId, // Use ProductId as Id since proto doesn't have separate Id
|
||||
ProductId = item.ProductId,
|
||||
ProductTitle = item.ProductTitle,
|
||||
UnitPrice = item.UnitPrice,
|
||||
DiscountPercent = item.MaxDiscountPercent,
|
||||
Quantity = item.Count,
|
||||
TotalPrice = item.TotalPrice,
|
||||
DiscountedPrice = item.FinalPrice
|
||||
}).ToList()
|
||||
});
|
||||
|
||||
// ========== GetUserOrders Mappings ==========
|
||||
|
||||
// BFF Proto Response → DTO
|
||||
config.NewConfig<GetUserOrdersResponse, GetUserOrdersResponseDto>()
|
||||
.MapWith(src => new GetUserOrdersResponseDto
|
||||
{
|
||||
MetaData = new Application.Common.Models.MetaData
|
||||
{
|
||||
CurrentPage = src.MetaData.CurrentPage,
|
||||
TotalPage = src.MetaData.TotalPage,
|
||||
PageSize = src.MetaData.PageSize,
|
||||
TotalCount = src.MetaData.TotalCount,
|
||||
HasPrevious = src.MetaData.HasPrevious,
|
||||
HasNext = src.MetaData.HasNext
|
||||
},
|
||||
Orders = src.Models.Select(order => new UserOrderDto
|
||||
{
|
||||
Id = order.Id,
|
||||
TrackingCode = order.TrackingCode ?? order.OrderNumber,
|
||||
Status = (int)order.DeliveryStatus,
|
||||
StatusTitle = GetDeliveryStatusTitle(order.DeliveryStatus),
|
||||
TotalPrice = order.TotalPrice,
|
||||
FinalPrice = order.TotalPrice - order.DiscountBalanceUsed,
|
||||
ItemCount = order.ItemsCount,
|
||||
CreatedAt = order.Created != null ? order.Created.ToDateTime() : DateTime.UtcNow
|
||||
}).ToList()
|
||||
});
|
||||
}
|
||||
|
||||
// Helper methods
|
||||
|
||||
private static string GetDeliveryStatusTitle(DeliveryStatus status) => status switch
|
||||
{
|
||||
DeliveryStatus.DeliveryPending => "در انتظار پردازش",
|
||||
DeliveryStatus.DeliveryProcessing => "در حال پردازش",
|
||||
DeliveryStatus.DeliveryShipped => "ارسال شده",
|
||||
DeliveryStatus.DeliveryDelivered => "تحویل داده شده",
|
||||
DeliveryStatus.DeliveryCancelled => "لغو شده",
|
||||
_ => "نامشخص"
|
||||
};
|
||||
|
||||
private static string ExtractProvince(string fullAddress)
|
||||
{
|
||||
// Simple extraction - assumes format: "Province, City, ..."
|
||||
var parts = fullAddress?.Split(',');
|
||||
return parts?.Length > 0 ? parts[0].Trim() : string.Empty;
|
||||
}
|
||||
|
||||
private static string ExtractCity(string fullAddress)
|
||||
{
|
||||
// Simple extraction - assumes format: "Province, City, ..."
|
||||
var parts = fullAddress?.Split(',');
|
||||
return parts?.Length > 1 ? parts[1].Trim() : string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using BackOffice.BFF.Application.ManualPaymentCQ.Queries.GetManualPayments;
|
||||
using BackOffice.BFF.Application.ManualPaymentCQ.Commands.CreateManualPayment;
|
||||
using BackOffice.BFF.ManualPayment.Protobuf;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using BackOffice.BFF.Protobuf.Common;
|
||||
|
||||
namespace BackOffice.BFF.WebApi.Common.Mappings;
|
||||
|
||||
public class ManualPaymentProfile : IRegister
|
||||
{
|
||||
void IRegister.Register(TypeAdapterConfig config)
|
||||
{
|
||||
// GetManualPaymentsResponseDto -> GetManualPaymentsResponse
|
||||
// config.NewConfig<GetManualPaymentsResponseDto, GetManualPaymentsResponse>()
|
||||
// .MapWith(src => new GetManualPaymentsResponse
|
||||
// {
|
||||
// MetaData = new MetaData
|
||||
// {
|
||||
// CurrentPage = src.MetaData.PageNumber,
|
||||
// PageSize = src.MetaData.PageSize,
|
||||
// TotalCount = src.MetaData.TotalCount,
|
||||
// TotalPage = (int)Math.Ceiling((double)src.MetaData.TotalCount / src.MetaData.PageSize)
|
||||
// },
|
||||
// Models = { (src.Models ?? Enumerable.Empty<ManualPaymentModel>())
|
||||
// .Select(m => new ManualPaymentProtoModel
|
||||
// {
|
||||
// Id = m.Id,
|
||||
// UserId = m.UserId,
|
||||
// UserFullName = m.UserFullName ?? string.Empty,
|
||||
// UserMobile = m.UserMobile ?? string.Empty,
|
||||
// Amount = m.Amount,
|
||||
// Type = m.Type,
|
||||
// TypeDisplay = m.TypeDisplay ?? string.Empty,
|
||||
// Description = m.Description ?? string.Empty,
|
||||
// ReferenceNumber = m.ReferenceNumber ?? string.Empty,
|
||||
// Status = m.Status,
|
||||
// StatusDisplay = m.StatusDisplay ?? string.Empty,
|
||||
// RequestedBy = m.RequestedBy,
|
||||
// RequestedByName = m.RequestedByName ?? string.Empty,
|
||||
// ApprovedBy = m.ApprovedBy ?? 0,
|
||||
// ApprovedByName = m.ApprovedByName ?? string.Empty,
|
||||
// ApprovedAt = m.ApprovedAt.HasValue
|
||||
// ? Timestamp.FromDateTime(DateTime.SpecifyKind(m.ApprovedAt.Value, DateTimeKind.Utc))
|
||||
// : null,
|
||||
// RejectionReason = m.RejectionReason ?? string.Empty,
|
||||
// TransactionId = m.TransactionId ?? 0,
|
||||
// Created = Timestamp.FromDateTime(DateTime.SpecifyKind(m.Created, DateTimeKind.Utc))
|
||||
// }) }
|
||||
// });
|
||||
|
||||
// CreateManualPaymentResponseDto -> CreateManualPaymentResponse
|
||||
// config.NewConfig<CreateManualPaymentResponseDto, CreateManualPaymentResponse>()
|
||||
// .MapWith(src => new CreateManualPaymentResponse
|
||||
// {
|
||||
// Id = src.Id,
|
||||
// TransactionId = src.TransactionId
|
||||
// });
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using Foursat.BackOffice.BFF.PublicMessage.Protobuf;
|
||||
|
||||
namespace BackOffice.BFF.WebApi.Common.Mappings;
|
||||
|
||||
using BackOffice.BFF.PublicMessage.Protobuf;
|
||||
using BackOffice.BFF.Application.PublicMessageCQ.Queries.GetAllMessages;
|
||||
using BackOffice.BFF.Application.PublicMessageCQ.Queries.GetActiveMessages;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
@@ -10,57 +11,57 @@ public class PublicMessageProfile : IRegister
|
||||
void IRegister.Register(TypeAdapterConfig config)
|
||||
{
|
||||
// GetAllMessages mappings
|
||||
config.NewConfig<GetAllMessagesRequest, GetAllMessagesQuery>()
|
||||
.Map(dest => dest.Status, src => src.Status != null ? (int?)src.Status.Value : null)
|
||||
.Map(dest => dest.MessageType, src => src.MessageType != null ? (int?)src.MessageType.Value : null)
|
||||
.Map(dest => dest.PageNumber, src => src.PageNumber)
|
||||
.Map(dest => dest.PageSize, src => src.PageSize);
|
||||
|
||||
config.NewConfig<GetAllMessagesQuery, GetAllMessagesResponse>()
|
||||
.Map(dest => dest.Messages, src => src.Messages)
|
||||
.Map(dest => dest.TotalCount, src => src.TotalCount)
|
||||
.Map(dest => dest.PageNumber, src => src.PageNumber)
|
||||
.Map(dest => dest.PageSize, src => src.PageSize);
|
||||
|
||||
config.NewConfig<AdminPublicMessageDto, AdminPublicMessageDto>()
|
||||
.Map(dest => dest.MessageId, src => src.MessageId)
|
||||
.Map(dest => dest.Title, src => src.Title)
|
||||
.Map(dest => dest.Content, src => src.Content)
|
||||
.Map(dest => dest.MessageType, src => src.MessageType)
|
||||
.Map(dest => dest.MessageTypeName, src => src.MessageTypeName)
|
||||
.Map(dest => dest.Priority, src => src.Priority)
|
||||
.Map(dest => dest.PriorityName, src => src.PriorityName)
|
||||
.Map(dest => dest.Status, src => src.Status)
|
||||
.Map(dest => dest.StatusName, src => src.StatusName)
|
||||
.Map(dest => dest.StartsAt, src => src.StartsAt.HasValue ? Timestamp.FromDateTime(src.StartsAt.Value.ToUniversalTime()) : null)
|
||||
.Map(dest => dest.ExpiresAt, src => src.ExpiresAt.HasValue ? Timestamp.FromDateTime(src.ExpiresAt.Value.ToUniversalTime()) : null)
|
||||
.Map(dest => dest.PublishedAt, src => src.PublishedAt.HasValue ? Timestamp.FromDateTime(src.PublishedAt.Value.ToUniversalTime()) : null)
|
||||
.Map(dest => dest.ArchivedAt, src => src.ArchivedAt.HasValue ? Timestamp.FromDateTime(src.ArchivedAt.Value.ToUniversalTime()) : null)
|
||||
.Map(dest => dest.IsDismissible, src => src.IsDismissible)
|
||||
.Map(dest => dest.TargetAudience, src => src.TargetAudience)
|
||||
.Map(dest => dest.Tags, src => src.Tags)
|
||||
.Map(dest => dest.Created, src => Timestamp.FromDateTime(src.Created.ToUniversalTime()))
|
||||
.Map(dest => dest.LastModified, src => Timestamp.FromDateTime(src.LastModified.ToUniversalTime()));
|
||||
|
||||
// GetActiveMessages mappings
|
||||
config.NewConfig<GetActiveMessagesRequest, GetActiveMessagesQuery>()
|
||||
.Map(dest => dest.MessageType, src => src.MessageType != null ? (int?)src.MessageType.Value : null)
|
||||
.Map(dest => dest.TargetAudience, src => src.TargetAudience);
|
||||
|
||||
config.NewConfig<GetActiveMessagesQuery, GetActiveMessagesResponse>()
|
||||
.Map(dest => dest.Messages, src => src.Messages);
|
||||
|
||||
config.NewConfig<PublicMessageDto, PublicMessageDto>()
|
||||
.Map(dest => dest.MessageId, src => src.MessageId)
|
||||
.Map(dest => dest.Title, src => src.Title)
|
||||
.Map(dest => dest.Content, src => src.Content)
|
||||
.Map(dest => dest.MessageType, src => src.MessageType)
|
||||
.Map(dest => dest.MessageTypeName, src => src.MessageTypeName)
|
||||
.Map(dest => dest.Priority, src => src.Priority)
|
||||
.Map(dest => dest.PriorityName, src => src.PriorityName)
|
||||
.Map(dest => dest.StartsAt, src => Timestamp.FromDateTime(src.StartsAt.ToUniversalTime()))
|
||||
.Map(dest => dest.ExpiresAt, src => Timestamp.FromDateTime(src.ExpiresAt.ToUniversalTime()))
|
||||
.Map(dest => dest.IsDismissible, src => src.IsDismissible)
|
||||
.Map(dest => dest.Tags, src => src.Tags);
|
||||
// config.NewConfig<GetAllMessagesRequest, GetAllMessagesQuery>()
|
||||
// .Map(dest => dest.Status, src => src.Status != null ? (int?)src.Status.Value : null)
|
||||
// .Map(dest => dest.MessageType, src => src.MessageType != null ? (int?)src.MessageType.Value : null)
|
||||
// .Map(dest => dest.PageNumber, src => src.PageNumber)
|
||||
// .Map(dest => dest.PageSize, src => src.PageSize);
|
||||
//
|
||||
// config.NewConfig<GetAllMessagesQuery, GetAllMessagesResponse>()
|
||||
// .Map(dest => dest.Messages, src => src.Messages)
|
||||
// .Map(dest => dest.TotalCount, src => src.TotalCount)
|
||||
// .Map(dest => dest.PageNumber, src => src.PageNumber)
|
||||
// .Map(dest => dest.PageSize, src => src.PageSize);
|
||||
//
|
||||
// config.NewConfig<AdminPublicMessageDto, AdminPublicMessageDto>()
|
||||
// .Map(dest => dest.MessageId, src => src.MessageId)
|
||||
// .Map(dest => dest.Title, src => src.Title)
|
||||
// .Map(dest => dest.Content, src => src.Content)
|
||||
// .Map(dest => dest.MessageType, src => src.MessageType)
|
||||
// .Map(dest => dest.MessageTypeName, src => src.MessageTypeName)
|
||||
// .Map(dest => dest.Priority, src => src.Priority)
|
||||
// .Map(dest => dest.PriorityName, src => src.PriorityName)
|
||||
// .Map(dest => dest.Status, src => src.Status)
|
||||
// .Map(dest => dest.StatusName, src => src.StatusName)
|
||||
// .Map(dest => dest.StartsAt, src => src.StartsAt.HasValue ? Timestamp.FromDateTime(src.StartsAt.Value.ToUniversalTime()) : null)
|
||||
// .Map(dest => dest.ExpiresAt, src => src.ExpiresAt.HasValue ? Timestamp.FromDateTime(src.ExpiresAt.Value.ToUniversalTime()) : null)
|
||||
// .Map(dest => dest.PublishedAt, src => src.PublishedAt.HasValue ? Timestamp.FromDateTime(src.PublishedAt.Value.ToUniversalTime()) : null)
|
||||
// .Map(dest => dest.ArchivedAt, src => src.ArchivedAt.HasValue ? Timestamp.FromDateTime(src.ArchivedAt.Value.ToUniversalTime()) : null)
|
||||
// .Map(dest => dest.IsDismissible, src => src.IsDismissible)
|
||||
// .Map(dest => dest.TargetAudience, src => src.TargetAudience)
|
||||
// .Map(dest => dest.Tags, src => src.Tags)
|
||||
// .Map(dest => dest.Created, src => Timestamp.FromDateTime(src.Created.ToUniversalTime()))
|
||||
// .Map(dest => dest.LastModified, src => Timestamp.FromDateTime(src.LastModified.ToUniversalTime()));
|
||||
//
|
||||
// // GetActiveMessages mappings
|
||||
// config.NewConfig<GetActiveMessagesRequest, GetActiveMessagesQuery>()
|
||||
// .Map(dest => dest.MessageType, src => src.MessageType != null ? (int?)src.MessageType.Value : null)
|
||||
// .Map(dest => dest.TargetAudience, src => src.TargetAudience);
|
||||
//
|
||||
// config.NewConfig<GetActiveMessagesQuery, GetActiveMessagesResponse>()
|
||||
// .Map(dest => dest.Messages, src => src.Messages);
|
||||
//
|
||||
// config.NewConfig<PublicMessageDto, PublicMessageDto>()
|
||||
// .Map(dest => dest.MessageId, src => src.MessageId)
|
||||
// .Map(dest => dest.Title, src => src.Title)
|
||||
// .Map(dest => dest.Content, src => src.Content)
|
||||
// .Map(dest => dest.MessageType, src => src.MessageType)
|
||||
// .Map(dest => dest.MessageTypeName, src => src.MessageTypeName)
|
||||
// .Map(dest => dest.Priority, src => src.Priority)
|
||||
// .Map(dest => dest.PriorityName, src => src.PriorityName)
|
||||
// .Map(dest => dest.StartsAt, src => Timestamp.FromDateTime(src.StartsAt.ToUniversalTime()))
|
||||
// .Map(dest => dest.ExpiresAt, src => Timestamp.FromDateTime(src.ExpiresAt.ToUniversalTime()))
|
||||
// .Map(dest => dest.IsDismissible, src => src.IsDismissible)
|
||||
// .Map(dest => dest.Tags, src => src.Tags);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,74 +12,74 @@ public class UserOrderProfile : IRegister
|
||||
{
|
||||
void IRegister.Register(TypeAdapterConfig config)
|
||||
{
|
||||
// UpdateOrderStatus mappings
|
||||
config.NewConfig<UpdateOrderStatusRequest, UpdateOrderStatusCommand>()
|
||||
.Map(dest => dest.OrderId, src => src.OrderId)
|
||||
.Map(dest => dest.NewStatus, src => src.NewStatus);
|
||||
|
||||
config.NewConfig<UpdateOrderStatusCommand, UpdateOrderStatusResponse>()
|
||||
.Map(dest => dest.Success, src => src.Success)
|
||||
.Map(dest => dest.Message, src => src.Message)
|
||||
.Map(dest => dest.OldStatus, src => src.OldStatus)
|
||||
.Map(dest => dest.NewStatus, src => src.NewStatus);
|
||||
|
||||
// GetOrdersByDateRange mappings
|
||||
config.NewConfig<GetOrdersByDateRangeRequest, GetOrdersByDateRangeQuery>()
|
||||
.Map(dest => dest.StartDate, src => src.StartDate.ToDateTime())
|
||||
.Map(dest => dest.EndDate, src => src.EndDate.ToDateTime())
|
||||
.Map(dest => dest.Status, src => src.Status != null ? (int?)src.Status.Value : null)
|
||||
.Map(dest => dest.UserId, src => src.UserId != null ? (long?)src.UserId.Value : null)
|
||||
.Map(dest => dest.PageNumber, src => src.PageNumber)
|
||||
.Map(dest => dest.PageSize, src => src.PageSize);
|
||||
|
||||
config.NewConfig<GetOrdersByDateRangeQuery, GetOrdersByDateRangeResponse>()
|
||||
.Map(dest => dest.MetaData, src => src.MetaData)
|
||||
.Map(dest => dest.Orders, src => src.Orders);
|
||||
|
||||
config.NewConfig<OrderSummaryDto, OrderSummaryDto>()
|
||||
.Map(dest => dest.OrderId, src => src.OrderId)
|
||||
.Map(dest => dest.OrderNumber, src => src.OrderNumber)
|
||||
.Map(dest => dest.UserId, src => src.UserId)
|
||||
.Map(dest => dest.UserFullName, src => src.UserFullName)
|
||||
.Map(dest => dest.TotalAmount, src => src.TotalAmount)
|
||||
.Map(dest => dest.Status, src => src.Status)
|
||||
.Map(dest => dest.StatusName, src => src.StatusName)
|
||||
.Map(dest => dest.ItemsCount, src => src.ItemsCount)
|
||||
.Map(dest => dest.CreatedAt, src => Timestamp.FromDateTime(src.CreatedAt.ToUniversalTime()));
|
||||
|
||||
// ApplyDiscountToOrder mappings
|
||||
config.NewConfig<ApplyDiscountToOrderRequest, ApplyDiscountToOrderCommand>()
|
||||
.Map(dest => dest.OrderId, src => src.OrderId)
|
||||
.Map(dest => dest.DiscountAmount, src => src.DiscountAmount)
|
||||
.Map(dest => dest.Reason, src => src.Reason);
|
||||
|
||||
config.NewConfig<ApplyDiscountToOrderCommand, ApplyDiscountToOrderResponse>()
|
||||
.Map(dest => dest.Success, src => src.Success)
|
||||
.Map(dest => dest.Message, src => src.Message)
|
||||
.Map(dest => dest.OriginalAmount, src => src.OriginalAmount)
|
||||
.Map(dest => dest.DiscountAmount, src => src.DiscountAmount)
|
||||
.Map(dest => dest.FinalAmount, src => src.FinalAmount);
|
||||
|
||||
// CalculateOrderPV mappings
|
||||
config.NewConfig<CalculateOrderPVRequest, CalculateOrderPVQuery>()
|
||||
.Map(dest => dest.OrderId, src => src.OrderId);
|
||||
|
||||
config.NewConfig<CalculateOrderPVQuery, CalculateOrderPVResponse>()
|
||||
.Map(dest => dest.OrderId, src => src.OrderId)
|
||||
.Map(dest => dest.TotalPv, src => src.TotalPV)
|
||||
.Map(dest => dest.Products, src => src.Products);
|
||||
|
||||
config.NewConfig<ProductPVDto, ProductPVDto>()
|
||||
.Map(dest => dest.ProductId, src => src.ProductId)
|
||||
.Map(dest => dest.ProductTitle, src => src.ProductTitle)
|
||||
.Map(dest => dest.Quantity, src => src.Quantity)
|
||||
.Map(dest => dest.UnitPv, src => src.UnitPV)
|
||||
.Map(dest => dest.TotalPv, src => src.TotalPV);
|
||||
|
||||
// CancelOrder mappings
|
||||
config.NewConfig<CancelOrderRequest, CancelOrderCommand>()
|
||||
.Map(dest => dest.OrderId, src => src.OrderId)
|
||||
.Map(dest => dest.CancelReason, src => src.CancelReason)
|
||||
.Map(dest => dest.RefundPayment, src => src.RefundPayment);
|
||||
// // UpdateOrderStatus mappings
|
||||
// config.NewConfig<UpdateOrderStatusRequest, UpdateOrderStatusCommand>()
|
||||
// .Map(dest => dest.OrderId, src => src.OrderId)
|
||||
// .Map(dest => dest.NewStatus, src => src.NewStatus);
|
||||
//
|
||||
// config.NewConfig<UpdateOrderStatusCommand, UpdateOrderStatusResponse>()
|
||||
// .Map(dest => dest.Success, src => src.Success)
|
||||
// .Map(dest => dest.Message, src => src.Message)
|
||||
// .Map(dest => dest.OldStatus, src => src.OldStatus)
|
||||
// .Map(dest => dest.NewStatus, src => src.NewStatus);
|
||||
//
|
||||
// // GetOrdersByDateRange mappings
|
||||
// config.NewConfig<GetOrdersByDateRangeRequest, GetOrdersByDateRangeQuery>()
|
||||
// .Map(dest => dest.StartDate, src => src.StartDate.ToDateTime())
|
||||
// .Map(dest => dest.EndDate, src => src.EndDate.ToDateTime())
|
||||
// .Map(dest => dest.Status, src => src.Status != null ? (int?)src.Status.Value : null)
|
||||
// .Map(dest => dest.UserId, src => src.UserId != null ? (long?)src.UserId.Value : null)
|
||||
// .Map(dest => dest.PageNumber, src => src.PageNumber)
|
||||
// .Map(dest => dest.PageSize, src => src.PageSize);
|
||||
//
|
||||
// config.NewConfig<GetOrdersByDateRangeQuery, GetOrdersByDateRangeResponse>()
|
||||
// .Map(dest => dest.MetaData, src => src.MetaData)
|
||||
// .Map(dest => dest.Orders, src => src.Orders);
|
||||
//
|
||||
// config.NewConfig<OrderSummaryDto, OrderSummaryDto>()
|
||||
// .Map(dest => dest.OrderId, src => src.OrderId)
|
||||
// .Map(dest => dest.OrderNumber, src => src.OrderNumber)
|
||||
// .Map(dest => dest.UserId, src => src.UserId)
|
||||
// .Map(dest => dest.UserFullName, src => src.UserFullName)
|
||||
// .Map(dest => dest.TotalAmount, src => src.TotalAmount)
|
||||
// .Map(dest => dest.Status, src => src.Status)
|
||||
// .Map(dest => dest.StatusName, src => src.StatusName)
|
||||
// .Map(dest => dest.ItemsCount, src => src.ItemsCount)
|
||||
// .Map(dest => dest.CreatedAt, src => Timestamp.FromDateTime(src.CreatedAt.ToUniversalTime()));
|
||||
//
|
||||
// // ApplyDiscountToOrder mappings
|
||||
// config.NewConfig<ApplyDiscountToOrderRequest, ApplyDiscountToOrderCommand>()
|
||||
// .Map(dest => dest.OrderId, src => src.OrderId)
|
||||
// .Map(dest => dest.DiscountAmount, src => src.DiscountAmount)
|
||||
// .Map(dest => dest.Reason, src => src.Reason);
|
||||
//
|
||||
// config.NewConfig<ApplyDiscountToOrderCommand, ApplyDiscountToOrderResponse>()
|
||||
// .Map(dest => dest.Success, src => src.Success)
|
||||
// .Map(dest => dest.Message, src => src.Message)
|
||||
// .Map(dest => dest.OriginalAmount, src => src.OriginalAmount)
|
||||
// .Map(dest => dest.DiscountAmount, src => src.DiscountAmount)
|
||||
// .Map(dest => dest.FinalAmount, src => src.FinalAmount);
|
||||
//
|
||||
// // CalculateOrderPV mappings
|
||||
// config.NewConfig<CalculateOrderPVRequest, CalculateOrderPVQuery>()
|
||||
// .Map(dest => dest.OrderId, src => src.OrderId);
|
||||
//
|
||||
// config.NewConfig<CalculateOrderPVQuery, CalculateOrderPVResponse>()
|
||||
// .Map(dest => dest.OrderId, src => src.OrderId)
|
||||
// .Map(dest => dest.TotalPv, src => src.TotalPV)
|
||||
// .Map(dest => dest.Products, src => src.Products);
|
||||
//
|
||||
// config.NewConfig<ProductPVDto, ProductPVDto>()
|
||||
// .Map(dest => dest.ProductId, src => src.ProductId)
|
||||
// .Map(dest => dest.ProductTitle, src => src.ProductTitle)
|
||||
// .Map(dest => dest.Quantity, src => src.Quantity)
|
||||
// .Map(dest => dest.UnitPv, src => src.UnitPV)
|
||||
// .Map(dest => dest.TotalPv, src => src.TotalPV);
|
||||
//
|
||||
// // CancelOrder mappings
|
||||
// config.NewConfig<CancelOrderRequest, CancelOrderCommand>()
|
||||
// .Map(dest => dest.OrderId, src => src.OrderId)
|
||||
// .Map(dest => dest.CancelReason, src => src.CancelReason)
|
||||
// .Map(dest => dest.RefundPayment, src => src.RefundPayment);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user