NCBACK-9 #7

Merged
backdev merged 12 commits from NCBACK-9 into dev 2025-12-17 13:41:28 +08:00
Showing only changes of commit 015f2f516c - Show all commits
@@ -52,27 +52,6 @@ public class RegRequestValidator implements Validator {
errors.rejectValue("fullName", "fullName.invalid.chars", errors.rejectValue("fullName", "fullName.invalid.chars",
"Name can only contain letters, spaces, hyphens and apostrophes"); "Name can only contain letters, spaces, hyphens and apostrophes");
} }
String[] nameParts = trimmedName.split("\\s+");
if (nameParts.length < 2) {
errors.rejectValue("fullName", "fullName.missing.parts",
"Please enter both first and last name");
}
for (int i = 0; i < nameParts.length; i++) {
String part = nameParts[i];
if (part.length() < 2 && part.length() > 0) {
errors.rejectValue("fullName", "fullName.part.too.short",
"Each name part must be at least 2 characters");
break;
}
if (!Character.isUpperCase(part.charAt(0))) {
errors.rejectValue("fullName", "fullName.capitalization",
"Each name part should start with capital letter");
break;
}
}
} }
private void validateCompanyName(String companyName, Errors errors) { private void validateCompanyName(String companyName, Errors errors) {