feat: update Foursat.CMSMicroservice.Protobuf package version and add mapping for GetAllWeeklyPoolsResponse
Build and Deploy / build (push) Successful in 1m48s
Build and Deploy / build (push) Successful in 1m48s
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using BackOffice.BFF.Application.CommissionCQ.Queries.GetWeeklyPool;
|
||||
using BackOffice.BFF.Application.CommissionCQ.Queries.GetAllWeeklyPools;
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
|
||||
namespace BackOffice.BFF.Application.Common.Mappings;
|
||||
@@ -7,7 +8,7 @@ public class CommissionProfile : IRegister
|
||||
{
|
||||
void IRegister.Register(TypeAdapterConfig config)
|
||||
{
|
||||
config.NewConfig< GetWeeklyCommissionPoolResponse,GetWeeklyPoolResponseDto>()
|
||||
config.NewConfig<GetWeeklyCommissionPoolResponse, GetWeeklyPoolResponseDto>()
|
||||
.Map(dest => dest.Id, src => src.Id)
|
||||
.Map(dest => dest.CalculatedAt, src => src.CalculatedAt)
|
||||
.Map(dest => dest.IsCalculated, src => src.IsCalculated)
|
||||
@@ -15,9 +16,31 @@ public class CommissionProfile : IRegister
|
||||
.Map(dest => dest.TotalPoolAmount, src => src.TotalPoolAmount)
|
||||
.Map(dest => dest.ValuePerBalance, src => src.ValuePerBalance)
|
||||
.Map(dest => dest.TotalBalances, src => src.TotalBalances)
|
||||
.Map(dest => dest.Created, src => src.Created.ToDateTimeOffset())
|
||||
;
|
||||
|
||||
|
||||
.Map(dest => dest.Created, src => src.Created.ToDateTimeOffset());
|
||||
|
||||
// CMS GetAllWeeklyPoolsResponse -> GetAllWeeklyPoolsResponseDto
|
||||
config.NewConfig<GetAllWeeklyPoolsResponse, GetAllWeeklyPoolsResponseDto>()
|
||||
.MapWith(src => new GetAllWeeklyPoolsResponseDto
|
||||
{
|
||||
MetaData = new MetaDataDto
|
||||
{
|
||||
TotalCount = (int)src.MetaData.TotalCount,
|
||||
PageSize = (int)src.MetaData.PageSize,
|
||||
CurrentPage = (int)src.MetaData.CurrentPage,
|
||||
TotalPages = (int)src.MetaData.TotalPage
|
||||
},
|
||||
Models = src.Models.Select(m => new WeeklyCommissionPoolDto
|
||||
{
|
||||
Id = m.Id,
|
||||
WeekDefinitionId = m.WeekDefinitionId,
|
||||
WeekDisplayName = m.WeekDisplayName,
|
||||
TotalPoolAmount = m.TotalPoolAmount,
|
||||
TotalBalances = m.TotalBalances,
|
||||
ValuePerBalance = m.ValuePerBalance,
|
||||
IsCalculated = m.IsCalculated,
|
||||
CalculatedAt = m.CalculatedAt != null ? m.CalculatedAt.ToDateTime() : null,
|
||||
Created = m.Created.ToDateTime()
|
||||
}).ToList()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Afrino.FMSMicroservice.Protobuf" Version="0.0.122" />
|
||||
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.159" />
|
||||
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.161" />
|
||||
|
||||
<PackageReference Include="Google.Protobuf" Version="3.23.3" />
|
||||
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.54.0" />
|
||||
|
||||
Reference in New Issue
Block a user