feat : kavenegar otp added

This commit is contained in:
soroush.asadi
2026-05-29 10:18:47 +03:30
parent 27e61d257e
commit 16cff8730b
22 changed files with 502 additions and 34 deletions
@@ -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.");
}
}