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:
@@ -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))
|
||||
}) }
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user