feat : kavenegar otp added
This commit is contained in:
@@ -37,3 +37,34 @@ public class RefreshTokenRequestValidator : AbstractValidator<RefreshTokenReques
|
||||
RuleFor(x => x.RefreshToken).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class RegisterRequestValidator : AbstractValidator<RegisterRequest>
|
||||
{
|
||||
public RegisterRequestValidator()
|
||||
{
|
||||
RuleFor(x => x.Phone)
|
||||
.NotEmpty()
|
||||
.Must(p => PhoneNormalizer.IsValidIranMobile(PhoneNormalizer.Normalize(p)))
|
||||
.WithMessage("Invalid Iranian mobile number.");
|
||||
|
||||
RuleFor(x => x.CafeName)
|
||||
.NotEmpty()
|
||||
.MaximumLength(100)
|
||||
.WithMessage("Cafe name must be between 1 and 100 characters.");
|
||||
}
|
||||
}
|
||||
|
||||
public class VerifyRegisterRequestValidator : AbstractValidator<VerifyRegisterRequest>
|
||||
{
|
||||
public VerifyRegisterRequestValidator()
|
||||
{
|
||||
RuleFor(x => x.Phone)
|
||||
.NotEmpty()
|
||||
.Must(p => PhoneNormalizer.IsValidIranMobile(PhoneNormalizer.Normalize(p)))
|
||||
.WithMessage("Invalid Iranian mobile number.");
|
||||
|
||||
RuleFor(x => x.Code)
|
||||
.Must(OtpNormalizer.IsValidSixDigitCode)
|
||||
.WithMessage("OTP must be 6 digits.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user