FINERACT-2646: Decouple accounting from charge via chargeId reference#6106
Open
mansi75 wants to merge 5 commits into
Open
FINERACT-2646: Decouple accounting from charge via chargeId reference#6106mansi75 wants to merge 5 commits into
mansi75 wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements FINERACT-2646 by removing accounting’s dependency on charge domain objects, switching accounting-side charge-related mappings to use chargeId references and (where needed) direct SQL reads of charge metadata. It also introduces a Modulith-based boundary test to prevent future cross-feature coupling regressions.
Changes:
- Replaced
ProductToGLAccountMapping’sChargeassociation with a scalarchargeIdand updated related repository queries and mapping helpers. - Reworked fee/penalty-to-income mapping reads to join
m_chargeviaJdbcTemplate(to avoid charge-domain navigation and EclipseLink native query binding issues). - Added an accounting cross-feature dependency boundary test (Spring Modulith) and adjusted accounting module test/build dependencies.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| fineract-loan/src/main/java/org/apache/fineract/accounting/productaccountmapping/service/LoanProductToGLAccountMappingHelper.java | Aligns constructor/super wiring with removal of charge-domain dependency. |
| fineract-accounting/src/test/java/org/apache/fineract/accounting/AccountingCrossFeatureBoundaryTest.java | Adds Modulith-based boundary test to detect cross-feature type references from accounting. |
| fineract-accounting/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/WorkingCapitalLoanProductAdvancedAccountingReadHelper.java | Reads charge name via SQL join instead of charge domain; maps to accounting DTOs. |
| fineract-accounting/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ShareProductToGLAccountMappingHelper.java | Removes charge-domain constructor dependency. |
| fineract-accounting/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/SavingsProductToGLAccountMappingHelper.java | Removes charge-domain constructor dependency and related comment block. |
| fineract-accounting/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingReadPlatformServiceImpl.java | Reworks charge-income mapping reads via JDBC and updates mapping behavior accordingly. |
| fineract-accounting/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingHelper.java | Stores chargeId instead of a Charge reference when persisting mappings. |
| fineract-accounting/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/domain/ProductToGLAccountMappingRepository.java | Updates JPQL to use chargeId column and removes charge-domain-specific queries. |
| fineract-accounting/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/domain/ProductToGLAccountMapping.java | Replaces Charge relation with Long chargeId field. |
| fineract-accounting/dependencies.gradle | Adds Modulith test dependency/version; currently still declares :fineract-charge implementation dependency. |
| fineract-accounting/build.gradle | Increases test JVM heap/metaspace limits for the accounting module. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fd16395 to
84fa296
Compare
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
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.
Description
This PR addresses FINERACT-2646 by decoupling the accounting module from the charge domain dependency.
The accounting code previously depended on charge domain objects directly. This change updates the accounting side to use the 'chargeId' reference instead, so accounting can identify and process charge-related mappings without requiring a direct dependency on the charge package/module.
This helps improve module boundaries and supports the ongoing Fineract modularization effort by reducing cross-feature coupling between accounting and charge. FINERACT-2646 is listed as a sub-task for decoupling the accounting package/module from third-party domains. :contentReference[oaicite:0]{index=0}
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!