FINERACT-405: Standardize mobile number validation across Client and Staff#5964
FINERACT-405: Standardize mobile number validation across Client and Staff#5964anubhavio wants to merge 1 commit into
Conversation
abdd8a2 to
3614282
Compare
|
|
||
| public class PhoneNumberConstants { | ||
|
|
||
| public static final String MOBILE_NUMBER_REGEX = |
There was a problem hiding this comment.
This should be configurable in a property, not fixed.
There was a problem hiding this comment.
@IOhacker Thanks for the feedback. I investigated the existing validation and configuration patterns in Fineract. To make the regex configurable, I plan to move it into FineractProperties and replace the Staff @pattern validation with a custom validator backed by a shared PhoneNumberValidationService, so both Client and Staff validations use the same configurable rule.
There was a problem hiding this comment.
@anubhavio that is the best approach to use the same configurable rule.
3614282 to
be97cdc
Compare
|
@adamsaghy I've addressed the review feedback and updated the implementation to use configurable mobile number validation backed by shared validation components. Requesting another review when convenient. Thanks! |
FAILURE: Build failed with an exception.
|
Move phone number validation from a hardcoded regex constant to a configurable property in FineractProperties. Introduce a shared PhoneNumberValidationService and custom @ValidPhoneNumber constraint so both client and staff validations use the same configurable rule. FINERACT-405: Centralize mobile number validation regex FINERACT-405: Add missing ASF license header WIP: save phone validation changes
be97cdc to
dfbb8ba
Compare
@adamsaghy Thanks for pointing that out. I fixed the compilation issues and updated the branch. The build should be green now. |
|
@anubhavio Please review the failing tests. |
Description
This PR replaces the hardcoded mobile number validation regex with a configurable property-based validation approach.
Changes
-Added phone validation configuration under FineractProperties
-Introduced PhoneNumberValidationService to provide a shared validation rule
-Added custom @ValidPhoneNumber constraint and PhoneNumberValidator
-Updated StaffCreateRequest and StaffUpdateRequest to use the new validator
-Updated ClientDataValidator to use the same configurable validation rule
-Removed the hardcoded phone number regex constant
-Added/updated tests for client mobile number validation