FINERACT-2316: localize interest rate chart validation#5038
Conversation
|
|
@sidshas03 one check is failing, could you please check? |
- Add proper Apache license headers to messages.properties and messages_de.properties - Fixes Apache RAT license audit failure - Resolves CI check failure for PR apache#5038
|
@adamsaghy could you please help in review of this PR? |
|
@sidshas03 are you still working on this PR? |
|
@sidshas03 Please rebase this PR with latest |
|
@sidshas03 Are you still working on this? -> Please rebase this PR with latest develop branch! |
Yes @adamsaghy I am working on it right now |
- Add proper Apache license headers to messages.properties and messages_de.properties - Fixes Apache RAT license audit failure - Resolves CI check failure for PR apache#5038
9d2296b to
deeff92
Compare
|
@sidshas03 Please rebase and squash your commits. |
| # dummy | ||
| org.apache.fineract.dummy.request.content.not-empty=Dummy request content must have a value | ||
|
|
||
| # Interest Rate Chart validation messages |
There was a problem hiding this comment.
Why these validation messages are duplicated? (fineract-command and fineract-provider module)
adamsaghy
left a comment
There was a problem hiding this comment.
Kindly see my concerns.
- Add localized validation messages for overlap and gap errors in interest rate chart slabs - Use DataValidatorBuilder with resource/parameter context for clean error codes - Add unit tests for validation error codes and arguments - Add German translations for validation messages
deeff92 to
22c5326
Compare
|
hey @adamsaghy
Thanks & Regards |
|
@adamsaghy I have updated the changes and it has successfully passed the Checks, please kindly review and let me know if there is any changes to be done |
Summary
This PR completes the i18n work for InterestRateChart slab validation and gets CI to green. Hard-coded/concatenated messages are replaced with message codes + arguments, message bundles are updated, focused tests cover overlap and gap scenarios, and
spotless/checkstyle/spotbugs/testspass locally.Supersedes #4793 (credit to the original author and discussion).
What changed (final approach adopted)
Domain stays Spring-free; standard validator pattern used
Resolves to clean codes:
validation.msg.savings.interestRateChart.slabs.overlapvalidation.msg.savings.interestRateChart.slabs.gapMessage bundles (added/updated in
fineract-provider/src/main/resources/messages.properties)Tests
Added/updated unit tests to trigger overlap/gap and assert the exact codes (and arguments where exposed).
CI
Ran
spotless,checkstyle,spotbugs, and tests locally — all green.Alternatives evaluated and not taken (with reasons)
MessageSource/LocaleContextHolderinto domain/assemblers — rejected to keep the domain layer clean; Fineract typically passes codes + args and resolves messages later.InterestRateChartDataValidatorBuildersubclass — rejected to avoid expanding API surface; standard builder suffices.resource()/parameter()set — led to double-prefixed codes (e.g.,validation.msg.interestRateChart.validation.msg.savings…).failWithCodeNoParameterAddedToErrorCodeon a builder with context — could still introduce unwanted prefixes ornullsegments based on builder state.ApiParameterError.parameterError(...)— functional but bypasses the usual validator aggregation flow; reverted for consistency.Scope (files of interest)
fineract-savings/src/main/java/.../InterestRateChart.javafineract-provider/src/main/resources/messages.properties(and optional locale bundles)fineract-savings/src/test/java/.../InterestRateChartValidationTest.javaCompatibility / API notes
globalisationMessageCodefor these validations now follows the standardvalidation.msg.savings.interestRateChart.*pattern.How to verify
Build & checks:
./gradlew spotlessApply checkstyleMain checkstyleTest spotbugsMain spotbugsTest testConfirm no hard-coded “overlap/gap” texts remain in
InterestRateChart.java.Run the updated tests; assertions should pass for the two codes above.
Housekeeping
@bharathcgowda - following up from #4793.
I’ve opened this PR to localise the InterestRateChart slab validation using the minimal approach we discussed. Thank you so much for allowing me to work on it. Please kindly review and let me know.