Add validation to Owner telephone field

Signed-off-by: kriti20041 <kritia2004@gmail.com>
This commit is contained in:
kriti20041 2025-12-25 19:45:45 +05:30
parent fd4361b118
commit 7b9760c42e

View file

@ -82,6 +82,9 @@ public class Owner extends Person {
this.city = city;
}
@NotBlank
@Pattern(regexp = "\\d{10}", message = "Telephone must be a 10-digit number")
@Column(name = "telephone")
public String getTelephone() {
return this.telephone;
}