fix: update commission payout mapping and handle null Created date
Build and Deploy / build (push) Successful in 2m30s
Build and Deploy / build (push) Successful in 2m30s
This commit is contained in:
+1
-1
@@ -59,7 +59,7 @@ public class GetUserPayoutsQueryHandler : IRequestHandler<GetUserPayoutsQuery, G
|
|||||||
Status = m.Status,
|
Status = m.Status,
|
||||||
WithdrawalMethod = m.WithdrawalMethod,
|
WithdrawalMethod = m.WithdrawalMethod,
|
||||||
IbanNumber = m.IbanNumber,
|
IbanNumber = m.IbanNumber,
|
||||||
Created = m.Created.ToDateTime(),
|
Created = m.Created!=null?m.Created.ToDateTime():DateTime.MinValue,
|
||||||
LastModified = m.LastModified?.ToDateTime()
|
LastModified = m.LastModified?.ToDateTime()
|
||||||
}).ToList()
|
}).ToList()
|
||||||
};
|
};
|
||||||
|
|||||||
+16
-16
@@ -4,21 +4,21 @@ public class GetUserPayoutsQueryValidator : AbstractValidator<GetUserPayoutsQuer
|
|||||||
{
|
{
|
||||||
public GetUserPayoutsQueryValidator()
|
public GetUserPayoutsQueryValidator()
|
||||||
{
|
{
|
||||||
RuleFor(x => x.PaginationState)
|
// RuleFor(x => x.PaginationState)
|
||||||
.NotNull()
|
// .NotNull()
|
||||||
.WithMessage("موقعیت صفحهبندی الزامی است");
|
// .WithMessage("موقعیت صفحهبندی الزامی است");
|
||||||
|
//
|
||||||
When(x => x.Filter != null, () =>
|
// When(x => x.Filter != null, () =>
|
||||||
{
|
// {
|
||||||
RuleFor(x => x.Filter!.UserId)
|
// RuleFor(x => x.Filter!.UserId)
|
||||||
.GreaterThan(0)
|
// .GreaterThan(0)
|
||||||
.When(x => x.Filter!.UserId.HasValue)
|
// .When(x => x.Filter!.UserId.HasValue)
|
||||||
.WithMessage("شناسه کاربر معتبر نیست");
|
// .WithMessage("شناسه کاربر معتبر نیست");
|
||||||
|
//
|
||||||
RuleFor(x => x.Filter!.WeekNumber)
|
// RuleFor(x => x.Filter!.WeekNumber)
|
||||||
.Matches(@"^\d{4}-W\d{2}$")
|
// .Matches(@"^\d{4}-W\d{2}$")
|
||||||
.When(x => !string.IsNullOrWhiteSpace(x.Filter!.WeekNumber))
|
// .When(x => !string.IsNullOrWhiteSpace(x.Filter!.WeekNumber))
|
||||||
.WithMessage("فرمت شماره هفته باید به صورت YYYY-Www باشد (مثال: 2025-W48)");
|
// .WithMessage("فرمت شماره هفته باید به صورت YYYY-Www باشد (مثال: 2025-W48)");
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,27 @@ public class CommissionProfile : IRegister
|
|||||||
{
|
{
|
||||||
void IRegister.Register(TypeAdapterConfig config)
|
void IRegister.Register(TypeAdapterConfig config)
|
||||||
{
|
{
|
||||||
|
// GetUserCommissionPayoutsRequest -> GetUserPayoutsQuery
|
||||||
|
config.NewConfig<GetUserCommissionPayoutsRequest, GetUserPayoutsQuery>()
|
||||||
|
.MapWith(src => new GetUserPayoutsQuery
|
||||||
|
{
|
||||||
|
PaginationState = src.PaginationState != null
|
||||||
|
? new BackOffice.BFF.Application.Common.Models.PaginationState
|
||||||
|
{
|
||||||
|
PageNumber = src.PaginationState.PageNumber,
|
||||||
|
PageSize = src.PaginationState.PageSize
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
Filter = src.Filter != null
|
||||||
|
? new BackOffice.BFF.Application.CommissionCQ.Queries.GetUserPayouts.GetUserPayoutsFilter
|
||||||
|
{
|
||||||
|
UserId = src.Filter.UserId,
|
||||||
|
WeekNumber = src.Filter.WeekNumber,
|
||||||
|
Status = src.Filter.Status
|
||||||
|
}
|
||||||
|
: null
|
||||||
|
});
|
||||||
|
|
||||||
// GetWeeklyPoolResponseDto -> GetWeeklyCommissionPoolResponse
|
// GetWeeklyPoolResponseDto -> GetWeeklyCommissionPoolResponse
|
||||||
config.NewConfig<GetWeeklyPoolResponseDto, GetWeeklyCommissionPoolResponse>()
|
config.NewConfig<GetWeeklyPoolResponseDto, GetWeeklyCommissionPoolResponse>()
|
||||||
.MapWith(src => new GetWeeklyCommissionPoolResponse
|
.MapWith(src => new GetWeeklyCommissionPoolResponse
|
||||||
|
|||||||
Reference in New Issue
Block a user