Generator Changes at 9/28/2025 6:32:18 AM
This commit is contained in:
@@ -5,5 +5,9 @@ public class CreateNewOtpTokenResponseDto
|
||||
public bool Success { get; set; }
|
||||
//پیام
|
||||
public string Message { get; set; }
|
||||
//تلاش باقی مانده
|
||||
public int RemainingAttempts { get; set; }
|
||||
//ثانیه باقی مانده
|
||||
public int RemainingSeconds { get; set; }
|
||||
|
||||
}
|
||||
@@ -7,5 +7,7 @@ public record VerifyOtpTokenCommand : IRequest<VerifyOtpTokenResponseDto>
|
||||
public string Purpose { get; init; }
|
||||
//کد
|
||||
public string Code { get; init; }
|
||||
//کد معرف والد
|
||||
public string ParentReferralCode { get; init; }
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using CMSMicroservice.Protobuf.Protos.OtpToken;
|
||||
using CMSMicroservice.Protobuf.Protos.OtpToken;
|
||||
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Commands.VerifyOtpToken;
|
||||
public class VerifyOtpTokenCommandHandler : IRequestHandler<VerifyOtpTokenCommand, VerifyOtpTokenResponseDto>
|
||||
|
||||
@@ -9,6 +9,8 @@ public class VerifyOtpTokenCommandValidator : AbstractValidator<VerifyOtpTokenCo
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.Code)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.ParentReferralCode)
|
||||
.NotEmpty();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
|
||||
@@ -7,5 +7,9 @@ public class VerifyOtpTokenResponseDto
|
||||
public string Message { get; set; }
|
||||
//توکن
|
||||
public string? Token { get; set; }
|
||||
//تلاش باقی مانده
|
||||
public int RemainingAttempts { get; set; }
|
||||
//ثانیه باقی مانده
|
||||
public int RemainingSeconds { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetUser;
|
||||
public record GetUserQuery : IRequest<GetUserResponseDto>
|
||||
{
|
||||
//شناسه
|
||||
public long Id { get; init; }
|
||||
|
||||
}
|
||||
@@ -1,14 +1,12 @@
|
||||
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetUser;
|
||||
public class GetUserQueryValidator : AbstractValidator<GetUserQuery>
|
||||
public class GetUserQueryValidator : AbstractValidator<Unit>
|
||||
{
|
||||
public GetUserQueryValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetUserQuery>.CreateWithOptions((GetUserQuery)model, x => x.IncludeProperties(propertyName)));
|
||||
var result = await ValidateAsync(ValidationContext<Unit>.CreateWithOptions((Unit)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
|
||||
Reference in New Issue
Block a user