Generator Changes at 9/28/2025 6:32:18 AM

This commit is contained in:
MeysamMoghaddam
2025-09-28 06:51:49 +03:30
parent 7f3e541633
commit dc0ba7a5ef
11 changed files with 26 additions and 15 deletions

View File

@@ -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; }
}

View File

@@ -7,5 +7,7 @@ public record VerifyOtpTokenCommand : IRequest<VerifyOtpTokenResponseDto>
public string Purpose { get; init; }
//کد
public string Code { get; init; }
//کد معرف والد
public string ParentReferralCode { get; init; }
}

View File

@@ -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>

View File

@@ -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) =>
{

View File

@@ -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; }
}

View File

@@ -1,7 +1,5 @@
namespace FrontOffice.BFF.Application.UserCQ.Queries.GetUser;
public record GetUserQuery : IRequest<GetUserResponseDto>
{
//شناسه
public long Id { get; init; }
}

View File

@@ -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);