diff --git a/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetUserPayouts/GetUserPayoutsQueryHandler.cs b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetUserPayouts/GetUserPayoutsQueryHandler.cs index 564de90..d6e2e81 100644 --- a/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetUserPayouts/GetUserPayoutsQueryHandler.cs +++ b/src/BackOffice.BFF.Application/CommissionCQ/Queries/GetUserPayouts/GetUserPayoutsQueryHandler.cs @@ -59,7 +59,7 @@ public class GetUserPayoutsQueryHandler : IRequestHandler x.PaginationState) - .NotNull() - .WithMessage("موقعیت صفحه‌بندی الزامی است"); - - When(x => x.Filter != null, () => - { - RuleFor(x => x.Filter!.UserId) - .GreaterThan(0) - .When(x => x.Filter!.UserId.HasValue) - .WithMessage("شناسه کاربر معتبر نیست"); - - RuleFor(x => x.Filter!.WeekNumber) - .Matches(@"^\d{4}-W\d{2}$") - .When(x => !string.IsNullOrWhiteSpace(x.Filter!.WeekNumber)) - .WithMessage("فرمت شماره هفته باید به صورت YYYY-Www باشد (مثال: 2025-W48)"); - }); + // RuleFor(x => x.PaginationState) + // .NotNull() + // .WithMessage("موقعیت صفحه‌بندی الزامی است"); + // + // When(x => x.Filter != null, () => + // { + // RuleFor(x => x.Filter!.UserId) + // .GreaterThan(0) + // .When(x => x.Filter!.UserId.HasValue) + // .WithMessage("شناسه کاربر معتبر نیست"); + // + // RuleFor(x => x.Filter!.WeekNumber) + // .Matches(@"^\d{4}-W\d{2}$") + // .When(x => !string.IsNullOrWhiteSpace(x.Filter!.WeekNumber)) + // .WithMessage("فرمت شماره هفته باید به صورت YYYY-Www باشد (مثال: 2025-W48)"); + // }); } } diff --git a/src/BackOffice.BFF.WebApi/Common/Mappings/CommissionProfile.cs b/src/BackOffice.BFF.WebApi/Common/Mappings/CommissionProfile.cs index 6dc9c0c..2133c44 100644 --- a/src/BackOffice.BFF.WebApi/Common/Mappings/CommissionProfile.cs +++ b/src/BackOffice.BFF.WebApi/Common/Mappings/CommissionProfile.cs @@ -12,6 +12,27 @@ public class CommissionProfile : IRegister { void IRegister.Register(TypeAdapterConfig config) { + // GetUserCommissionPayoutsRequest -> GetUserPayoutsQuery + config.NewConfig() + .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 config.NewConfig() .MapWith(src => new GetWeeklyCommissionPoolResponse