Skip to content

FINERACT-2647: Decouple client module#6110

Open
mansi75 wants to merge 2 commits into
apache:developfrom
mansi75:FINERACT-2647-decouple-client
Open

FINERACT-2647: Decouple client module#6110
mansi75 wants to merge 2 commits into
apache:developfrom
mansi75:FINERACT-2647-decouple-client

Conversation

@mansi75

@mansi75 mansi75 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Description

This PR addresses FINERACT-2647 by decoupling the client module from cross-feature dependencies.

The client code previously depended directly on classes from other feature packages/modules. This change introduces and moves the required client-facing contracts and shared types into fineract-core, so the client module can interact through core-level abstractions instead of depending directly on unrelated feature implementations.

The client module is now aligned to depend only on allowed shared modules such as fineract-core and fineract-command. Implementations in other feature areas, including loan, savings, charge, collateral, note, accounting, staff, working days, holidays, and data queries, have been updated to use the new boundaries.

This helps improve module boundaries and supports the ongoing Fineract modularization effort by reducing cross-feature coupling for the client package/module. FINERACT-2647 is listed as a sub-task for decoupling the client package/module from third-party domains.

A Spring Modulith boundary test has also been added to verify that the client package does not regress and introduce direct cross-feature dependencies again.

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per our guidelines
  • 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 for verifying the changes made.
  • Follow our 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

Copilot AI review requested due to automatic review settings July 9, 2026 08:34
@adamsaghy

Copy link
Copy Markdown
Contributor

@mansi75 Please rebase

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enforces Spring Modulith feature boundaries for the Client feature by replacing cross-feature implementation dependencies with core-level read/write contracts (interfaces) and minimal DTO projections, and by adding an automated boundary test to prevent regressions.

Changes:

  • Introduces multiple Client* read/write contracts and minimal DTOs in fineract-core, implemented by the respective feature modules.
  • Refactors client-facing provider services/resources to depend on these contracts (instead of other feature-domain types).
  • Adds a Spring Modulith boundary test and updates Gradle dependencies / test JVM settings to support the new architecture checks.

Reviewed changes

Copilot reviewed 44 out of 77 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
fineract-savings/src/main/java/org/apache/fineract/portfolio/savings/service/ClientSavingsReadServiceImpl.java Implements core client savings read-contract in savings module
fineract-savings/src/main/java/org/apache/fineract/portfolio/savings/service/ClientSavingsActivationServiceImpl.java Implements core client savings activation contract in savings module
fineract-provider/src/test/java/org/apache/fineract/portfolio/client/service/ClientReadPlatformServiceImplTest.java Updates mocks to use new collateral read-contract
fineract-provider/src/test/java/org/apache/fineract/portfolio/client/ClientCrossFeatureBoundaryTest.java Adds Modulith boundary regression test for Client module
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsProductReadPlatformServiceImpl.java Implements client savings product lookup contract
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java Implements client savings account lookup contract
fineract-provider/src/main/java/org/apache/fineract/portfolio/note/service/NoteWritePlatformServiceJpaRepositoryImpl.java Implements client note cleanup contract
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorReadPlatformServiceImpl.java Implements client obligee read-contract
fineract-provider/src/main/java/org/apache/fineract/portfolio/collateralmanagement/service/ClientCollateralReadServiceImpl.java Implements core collateral read-contract in collateral module
fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java Refactors client lifecycle operations behind core contracts
fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientTransactionWritePlatformServiceJpaRepositoryImpl.java Refactors accounting/charge dependencies behind core contracts
fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientTemplateReadPlatformServiceImpl.java Uses client lookup contracts for template generation
fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientReadPlatformServiceImpl.java Moves collateral mapping behind collateral read-contract
fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeWritePlatformServiceImpl.java Uses charge read-contract and client journal-entry contract
fineract-provider/src/main/java/org/apache/fineract/portfolio/client/package-info.java Declares Client as a Modulith application module
fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientTransaction.java Changes accounting bridge mapping to use charge projections
fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientChargeRepositoryWrapper.java Uses charge read-contract for currency enrichment
fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientCharge.java Decouples from Charge entity by persisting chargeId
fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientsApiResource.java Switches to client-facing lookup/account-summary contracts
fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientChargesApiResource.java Uses client-applicable charge lookup contract
fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientAddressApiResource.java Depends on address read-service interface (not impl)
fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeReadPlatformServiceImpl.java Implements client-applicable charge lookup contract
fineract-provider/src/main/java/org/apache/fineract/portfolio/accountdetails/service/AccountDetailsReadPlatformServiceJpaRepositoryImpl.java Implements client account-summary JSON contract
fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/EntityDatatableChecksReadService.java Extracts client-only datatable template contract
fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformService.java Extracts client journal-entry posting contract
fineract-provider/dependencies.gradle Adds Spring Modulith dependencies / version
fineract-provider/build.gradle Adjusts provider test JVM memory settings
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/service/ClientLoanReadServiceImpl.java Implements core loan-status projection read-contract
fineract-core/src/main/java/org/apache/fineract/portfolio/savings/service/ClientSavingsReadService.java Adds client savings read-contract
fineract-core/src/main/java/org/apache/fineract/portfolio/savings/service/ClientSavingsProductLookupReadService.java Adds client savings product lookup contract
fineract-core/src/main/java/org/apache/fineract/portfolio/savings/service/ClientSavingsActivationService.java Adds client savings activation contract
fineract-core/src/main/java/org/apache/fineract/portfolio/savings/service/ClientSavingsAccountLookupReadService.java Adds client savings account lookup contract
fineract-core/src/main/java/org/apache/fineract/portfolio/note/service/ClientNoteWriteService.java Adds client note cleanup contract
fineract-core/src/main/java/org/apache/fineract/portfolio/loanaccount/service/ClientLoanReadService.java Adds loan-status projection read-contract
fineract-core/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/ClientObligeeReadService.java Adds obligee lookup read-contract
fineract-core/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/data/ObligeeData.java Adds obligee DTO in core
fineract-core/src/main/java/org/apache/fineract/portfolio/group/exception/GroupNotFoundException.java Moves/introduces group exception into core
fineract-core/src/main/java/org/apache/fineract/portfolio/group/exception/GroupMemberCountNotInPermissibleRangeException.java Moves/introduces group exception into core
fineract-core/src/main/java/org/apache/fineract/portfolio/group/domain/GroupRepository.java Introduces/moves group repository into core
fineract-core/src/main/java/org/apache/fineract/portfolio/collateralmanagement/service/ClientCollateralReadService.java Adds collateral DTO read-contract
fineract-core/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddress.java Introduces client-address entity in core
fineract-core/src/main/java/org/apache/fineract/portfolio/client/data/ClientLoanStatusData.java Adds minimal loan-status DTO for client-close checks
fineract-core/src/main/java/org/apache/fineract/portfolio/charge/service/ClientChargeReadService.java Adds charge-definition projection contract for client
fineract-core/src/main/java/org/apache/fineract/portfolio/charge/service/ClientApplicableChargeReadService.java Adds “charges applicable to clients” lookup contract
fineract-core/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeEnumerations.java Adds/moves charge enumeration mapping helpers into core
fineract-core/src/main/java/org/apache/fineract/portfolio/charge/exception/ChargeNotFoundException.java Adds/moves charge not-found exception into core
fineract-core/src/main/java/org/apache/fineract/portfolio/charge/exception/ChargeCannotBeAppliedToException.java Adds/moves charge applicability exception into core
fineract-core/src/main/java/org/apache/fineract/portfolio/charge/domain/ChargePaymentMode.java Adds/moves charge payment mode enum into core
fineract-core/src/main/java/org/apache/fineract/portfolio/charge/domain/ChargeCalculationType.java Adds/moves charge calculation enum into core
fineract-core/src/main/java/org/apache/fineract/portfolio/charge/domain/ChargeAppliesTo.java Adds/moves charge applies-to enum into core
fineract-core/src/main/java/org/apache/fineract/portfolio/charge/data/ClientChargeDefinitionData.java Adds minimal charge-definition DTO for client feature
fineract-core/src/main/java/org/apache/fineract/portfolio/address/service/AddressWritePlatformService.java Introduces address write-service interface into core
fineract-core/src/main/java/org/apache/fineract/portfolio/address/service/AddressReadPlatformService.java Introduces address read-service interface into core
fineract-core/src/main/java/org/apache/fineract/portfolio/address/filter/ClientAddressSearchParam.java Introduces client address search filter DTO
fineract-core/src/main/java/org/apache/fineract/portfolio/address/domain/Address.java Introduces/moves address entity into core
fineract-core/src/main/java/org/apache/fineract/portfolio/address/data/ClientAddressData.java Introduces client address DTO
fineract-core/src/main/java/org/apache/fineract/portfolio/accountdetails/service/ClientAccountSummaryReadService.java Adds client account summary JSON contract
fineract-core/src/main/java/org/apache/fineract/organisation/workingdays/exception/WorkingDaysNotFoundException.java Introduces/moves working-days exception into core
fineract-core/src/main/java/org/apache/fineract/organisation/workingdays/domain/WorkingDaysRepositoryWrapper.java Introduces/moves working-days wrapper into core
fineract-core/src/main/java/org/apache/fineract/organisation/workingdays/domain/WorkingDaysRepository.java Introduces/moves working-days repository into core
fineract-core/src/main/java/org/apache/fineract/organisation/staff/service/StaffReadPlatformService.java Introduces/moves staff read service interface into core
fineract-core/src/main/java/org/apache/fineract/organisation/staff/domain/StaffRepositoryWrapper.java Introduces/moves staff repository wrapper into core
fineract-core/src/main/java/org/apache/fineract/organisation/staff/domain/StaffRepository.java Introduces/moves staff repository into core
fineract-core/src/main/java/org/apache/fineract/organisation/holiday/exception/HolidayNotFoundException.java Introduces/moves holiday exception into core
fineract-core/src/main/java/org/apache/fineract/organisation/holiday/domain/HolidayRepositoryWrapper.java Introduces/moves holiday wrapper into core
fineract-core/src/main/java/org/apache/fineract/organisation/holiday/domain/HolidayRepository.java Introduces/moves holiday repository into core
fineract-core/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientRejectBusinessEvent.java Introduces client reject business event in core
fineract-core/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientCreateBusinessEvent.java Introduces client create business event in core
fineract-core/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientBusinessEvent.java Introduces client business event base class
fineract-core/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientActivateBusinessEvent.java Introduces client activate business event in core
fineract-core/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/EntityDatatableChecksWritePlatformService.java Introduces/moves datatable checks write service interface
fineract-core/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ClientDatatableChecksReadService.java Adds client-only datatable templates contract
fineract-core/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/exception/AccountNumberFormatNotFoundException.java Introduces/moves account number format exception
fineract-core/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/domain/AccountNumberFormatRepositoryWrapper.java Introduces/moves account number format wrapper
fineract-core/src/main/java/org/apache/fineract/accounting/journalentry/service/ClientJournalEntryWriteService.java Adds client journal-entry posting contract
fineract-charge/src/main/java/org/apache/fineract/portfolio/charge/service/ClientChargeReadServiceImpl.java Implements charge-definition projection contract in charge module
build.gradle Adjusts CycloneDX task configuration for all projects

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mansi75

mansi75 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@adamsaghy Sure

@mansi75 mansi75 force-pushed the FINERACT-2647-decouple-client branch from 582daaf to 58a0144 Compare July 9, 2026 12:01
@mansi75 mansi75 changed the title Fineract 2647 decouple client Fineract-2647: Decouple client module Jul 9, 2026
@mansi75 mansi75 changed the title Fineract-2647: Decouple client module FINERACT-2647: Decouple client module Jul 9, 2026
@mansi75 mansi75 force-pushed the FINERACT-2647-decouple-client branch from 58a0144 to 48aa4a5 Compare July 9, 2026 14:07
@mansi75 mansi75 force-pushed the FINERACT-2647-decouple-client branch from 48aa4a5 to ece0814 Compare July 9, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants