43 lines
1.0 KiB
Java
43 lines
1.0 KiB
Java
package com.billpaymentservice.bbps.dto.auth;
|
|
|
|
import jakarta.validation.constraints.NotNull;
|
|
import jakarta.validation.constraints.Pattern;
|
|
import jakarta.validation.constraints.Size;
|
|
|
|
public class VerifyOtpRequest {
|
|
|
|
@NotNull(message = "Mobile number cannot be null.")
|
|
@Size(min = 10, max = 10, message = "Mobile number must be exactly 10 digits.")
|
|
@Pattern(regexp = "^[0-9]{10}$", message = "Mobile number must contain only digits.")
|
|
private String mobile;
|
|
|
|
@NotNull(message = "OTP cannot be null.")
|
|
@Size(min = 6, max = 6, message = "OTP must be exactly 6 digits.")
|
|
@Pattern(regexp = "^[0-9]{6}$", message = "OTP must contain only 6 digits.")
|
|
private String otp;
|
|
|
|
public VerifyOtpRequest() {
|
|
}
|
|
|
|
public VerifyOtpRequest(String mobile, String otp) {
|
|
this.mobile = mobile;
|
|
this.otp = otp;
|
|
}
|
|
|
|
public String getMobile() {
|
|
return mobile;
|
|
}
|
|
|
|
public void setMobile(String mobile) {
|
|
this.mobile = mobile;
|
|
}
|
|
|
|
public String getOtp() {
|
|
return otp;
|
|
}
|
|
|
|
public void setOtp(String otp) {
|
|
this.otp = otp;
|
|
}
|
|
}
|