-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fineract 2316 localize interest rate chart validation #5038
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sidshas03
wants to merge
6
commits into
apache:develop
Choose a base branch
from
sidshas03:FINERACT-2316-localize-interest-rate-chart-validation
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fineract 2316 localize interest rate chart validation #5038
sidshas03
wants to merge
6
commits into
apache:develop
from
sidshas03:FINERACT-2316-localize-interest-rate-chart-validation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…args); add tests; fix CI - Replace hard-coded error messages with message codes in InterestRateChart.java - Use failWithCode method instead of failWithCodeNoParameterAddedToErrorCode - Add message keys to fineract-provider/src/main/resources/messages.properties - Add German translations in messages_de.properties - Create unit tests for overlap and gap validation error codes and arguments - Update tests to assert both error codes and arguments properly - All quality checks pass (spotless, checkstyle, spotbugs, tests) This supersedes PR apache#4793 and provides proper internationalization support for interest rate chart validation error messages without domain layer coupling.
…l keys - Switch from failWithCode to failWithCodeNoParameterAddedToErrorCode for proper error code generation - Update tests to expect correct error codes without 'null' parameter - Error codes now properly resolve to: - validation.msg.interestRateChart.validation.msg.savings.interestRateChart.slabs.overlap - validation.msg.interestRateChart.validation.msg.savings.interestRateChart.slabs.gap - All quality checks pass (spotless, checkstyle, spotbugs, tests)
…efix) - Use direct ApiParameterError creation for overlap/gap validations - Avoid double-prefixed error codes by bypassing DataValidatorBuilder - Error codes now resolve to clean format: - validation.msg.savings.interestRateChart.slabs.overlap - validation.msg.savings.interestRateChart.slabs.gap - Remove hard-coded error messages, let i18n system handle them - All quality checks pass (spotless, checkstyle, spotbugs, tests)
…ith short keys for overlap/gap - Replace direct ApiParameterError creation with DataValidatorBuilder approach - Use resource('savings.interestRateChart') and parameter('slabs') context - Short keys: 'overlap' and 'gap' instead of full validation.msg.* keys - Error codes now resolve to: validation.msg.savings.interestRateChart.slabs.overlap/gap - Update tests to use same DataValidatorBuilder pattern - All quality checks pass (spotless, checkstyle, spotbugs, tests)
|
@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? |
galovics
approved these changes
Oct 10, 2025
@sidshas03 are you still working on this PR? |
@sidshas03 Please rebase this PR with latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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/tests
pass 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.overlap
validation.msg.savings.interestRateChart.slabs.gap
Message 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
/LocaleContextHolder
into domain/assemblers — rejected to keep the domain layer clean; Fineract typically passes codes + args and resolves messages later.InterestRateChartDataValidatorBuilder
subclass — 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…
).failWithCodeNoParameterAddedToErrorCode
on a builder with context — could still introduce unwanted prefixes ornull
segments 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.java
fineract-provider/src/main/resources/messages.properties
(and optional locale bundles)fineract-savings/src/test/java/.../InterestRateChartValidationTest.java
Compatibility / API notes
globalisationMessageCode
for these validations now follows the standardvalidation.msg.savings.interestRateChart.*
pattern.How to verify
Build & checks:
./gradlew spotlessApply checkstyleMain checkstyleTest spotbugsMain spotbugsTest test
Confirm 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.