feat: update commission payout model with user names and timestamps
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 4m11s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 4m11s
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using CMSMicroservice.Application.CommissionCQ.Queries.GetAvailableWeeks;
|
||||
using CMSMicroservice.Application.CommissionCQ.Queries.GetUserCommissionPayouts;
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Mapster;
|
||||
@@ -35,5 +36,28 @@ public class CommissionProfile : IRegister
|
||||
.Map(dest => dest.TotalPoolAmount, src => src.TotalPoolAmount ?? 0)
|
||||
.Map(dest => dest.EligibleUsersCount, src => src.EligibleUsersCount ?? 0)
|
||||
.Map(dest => dest.DisplayText, src => src.DisplayText);
|
||||
|
||||
// GetUserCommissionPayouts Response Model Mapping
|
||||
config.NewConfig<GetUserCommissionPayoutsResponseModel, UserCommissionPayoutModel>()
|
||||
.Map(dest => dest.Id, src => src.Id)
|
||||
.Map(dest => dest.UserId, src => src.UserId)
|
||||
.Map(dest => dest.UserName, src => $"{src.FirstName} {src.LastName}")
|
||||
.Map(dest => dest.WeekNumber, src => src.WeekNumber)
|
||||
.Map(dest => dest.WeeklyPoolId, src => src.WeeklyPoolId)
|
||||
.Map(dest => dest.BalancesEarned, src => src.BalancesEarned)
|
||||
.Map(dest => dest.ValuePerBalance, src => src.ValuePerBalance)
|
||||
.Map(dest => dest.TotalAmount, src => src.TotalAmount)
|
||||
.Map(dest => dest.Status, src => (int)src.Status)
|
||||
.Map(dest => dest.PaidAt, src => src.PaidAt.HasValue
|
||||
? Timestamp.FromDateTime(src.PaidAt.Value.ToUniversalTime())
|
||||
: null)
|
||||
.Map(dest => dest.WithdrawalMethod, src => src.WithdrawalMethod.HasValue
|
||||
? (int)src.WithdrawalMethod.Value
|
||||
: (int?)null)
|
||||
.Map(dest => dest.IbanNumber, src => src.IbanNumber ?? string.Empty)
|
||||
.Map(dest => dest.WithdrawnAt, src => src.WithdrawnAt.HasValue
|
||||
? Timestamp.FromDateTime(src.WithdrawnAt.Value.ToUniversalTime())
|
||||
: null)
|
||||
.Map(dest => dest.Created, src => Timestamp.FromDateTimeOffset(src.Created));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user