You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "anubhavio (via GitHub)" <gi...@apache.org> on 2026/06/09 11:17:38 UTC

[PR] FINERACT-405: Centralize mobile number validation regex [fineract]

anubhavio opened a new pull request, #5964:
URL: https://github.com/apache/fineract/pull/5964

   ## Description
   
   Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)
   
   ## Checklist
   
   Please make sure these boxes are checked before submitting your pull request - thanks!
   
   - [ ] Write the commit message as per [our guidelines](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#pull-requests)
   - [ ] Acknowledge that we will not review PRs that are not passing the build _("green")_ - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
   - [ ] Create/update [unit or integration tests](https://fineract.apache.org/docs/current/#_testing) for verifying the changes made.
   - [ ] Follow our [coding conventions](https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions).
   - [ ] Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
   - [ ] [This PR must not be a "code dump"](https://cwiki.apache.org/confluence/display/FINERACT/Pull+Request+Size+Limit). Large changes can be made in a branch, with assistance. Ask for help on the [developer mailing list](https://fineract.apache.org/#contribute).
   
   Your assigned reviewer(s) will follow our [guidelines for code reviews](https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-405: Centralize mobile number validation regex [fineract]

Posted by "anubhavio (via GitHub)" <gi...@apache.org>.
anubhavio commented on code in PR #5964:
URL: https://github.com/apache/fineract/pull/5964#discussion_r3385148870


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/validation/PhoneNumberConstants.java:
##########
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.infrastructure.core.validation;
+
+public class PhoneNumberConstants {
+
+    public static final String MOBILE_NUMBER_REGEX =

Review Comment:
   Thanks for the feedback.
   
   I agree that centralizing the regex into a constant still leaves it fixed in code. Since StaffCreateRequest and StaffUpdateRequest currently use Bean Validation @Pattern annotations, making the regex configurable would require moving those validations away from compile-time constants.
   
   Would you prefer a Spring configuration property (e.g. fineract.mobile.regex) or a Global Configuration backed approach?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-405: Standardize mobile number validation across Client and Staff [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #5964:
URL: https://github.com/apache/fineract/pull/5964#issuecomment-4738301361

   > @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.
   
   * What went wrong:
   Execution failed for task ':fineract-provider:compileJava'.
   > Compilation failed; see the compiler output below.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-405: Standardize mobile number validation across Client and Staff [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy closed pull request #5964: FINERACT-405: Standardize mobile number validation across Client and Staff
URL: https://github.com/apache/fineract/pull/5964


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-405: Centralize mobile number validation regex [fineract]

Posted by "anubhavio (via GitHub)" <gi...@apache.org>.
anubhavio commented on code in PR #5964:
URL: https://github.com/apache/fineract/pull/5964#discussion_r3385148870


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/validation/PhoneNumberConstants.java:
##########
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.infrastructure.core.validation;
+
+public class PhoneNumberConstants {
+
+    public static final String MOBILE_NUMBER_REGEX =

Review Comment:
   Thanks for the feedback.
   
   I agree that centralizing the regex into a constant still leaves it fixed in code. Since StaffCreateRequest and StaffUpdateRequest currently use Bean Validation @Pattern annotations, making the regex configurable would require moving those validations away from compile-time constants.
   
   Would you prefer a Spring configuration property (e.g. fineract.mobile.regex) or a Global Configuration backed approach?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-405: Standardize mobile number validation across Client and Staff [fineract]

Posted by "anubhavio (via GitHub)" <gi...@apache.org>.
anubhavio commented on PR #5964:
URL: https://github.com/apache/fineract/pull/5964#issuecomment-4738609585

   > > @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.
   > 
   > * What went wrong:
   >   Execution failed for task ':fineract-provider:compileJava'.
   > 
   > > Compilation failed; see the compiler output below.
   
   @adamsaghy  Thanks for pointing that out. I fixed the compilation issues and updated the branch. The build should be green now.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-405: Centralize mobile number validation regex [fineract]

Posted by "anubhavio (via GitHub)" <gi...@apache.org>.
anubhavio commented on code in PR #5964:
URL: https://github.com/apache/fineract/pull/5964#discussion_r3387825365


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/validation/PhoneNumberConstants.java:
##########
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.infrastructure.core.validation;
+
+public class PhoneNumberConstants {
+
+    public static final String MOBILE_NUMBER_REGEX =

Review 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.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-405: Standardize mobile number validation across Client and Staff [fineract]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5964:
URL: https://github.com/apache/fineract/pull/5964#issuecomment-5017937656

   This pull request seems to be stale.  Are you still planning to work on it?  We will automatically close it in 30 days.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-405: Standardize mobile number validation across Client and Staff [fineract]

Posted by "anubhavio (via GitHub)" <gi...@apache.org>.
anubhavio commented on PR #5964:
URL: https://github.com/apache/fineract/pull/5964#issuecomment-4737983213

   @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!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-405: Standardize mobile number validation across Client and Staff [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #5964:
URL: https://github.com/apache/fineract/pull/5964#issuecomment-4741775600

   @anubhavio Please review the failing tests.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-405: Centralize mobile number validation regex [fineract]

Posted by "IOhacker (via GitHub)" <gi...@apache.org>.
IOhacker commented on code in PR #5964:
URL: https://github.com/apache/fineract/pull/5964#discussion_r3383333888


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/validation/PhoneNumberConstants.java:
##########
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.infrastructure.core.validation;
+
+public class PhoneNumberConstants {
+
+    public static final String MOBILE_NUMBER_REGEX =

Review Comment:
   This should be configurable in a property, not fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-405: Centralize mobile number validation regex [fineract]

Posted by "IOhacker (via GitHub)" <gi...@apache.org>.
IOhacker commented on code in PR #5964:
URL: https://github.com/apache/fineract/pull/5964#discussion_r3390335780


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/validation/PhoneNumberConstants.java:
##########
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.infrastructure.core.validation;
+
+public class PhoneNumberConstants {
+
+    public static final String MOBILE_NUMBER_REGEX =

Review Comment:
   @anubhavio that is the best approach to use the same configurable rule.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org