feat: add Mapster profiles and enable DiscountOrder handlers
All checks were successful
Build and Deploy / build (push) Successful in 2m14s

This commit is contained in:
masoodafar-web
2025-12-08 21:10:21 +03:30
parent dedc0b809f
commit ce3b5db822
57 changed files with 2125 additions and 374 deletions

View File

@@ -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))
}) }
});
}
}