Bhavya-Sonigra opened a new pull request, #6846: URL: https://github.com/apache/fineract/pull/6846
## Description ### Overview - **Scope**: Part of [FINERACT-3147](https://issues.apache.org/jira/browse/FINERACT-3147) / [FINERACT-3149](https://issues.apache.org/jira/browse/FINERACT-3149) ("Split large service classes by functionality"), addressing the decomposition of the `LoanWritePlatformServiceJpaRepositoryImpl` monolith (~3,700 lines). - **Design & Compatibility**: Pure architectural refactoring with zero behavioral or calculation changes. All 13 extracted transaction methods continue to be exposed through `LoanWritePlatformServiceJpaRepositoryImpl` via direct delegation, guaranteeing complete backward compatibility for all existing callers. - **Verification**: Validated with dedicated unit tests for delegation and transaction execution, Spotless, Checkstyle, RAT checks, and verified against all loan transaction integration test suites. --- ### Summary of Changes | Area / Component | Change Type | Details | | :--- | :--- | :--- | | `fineract-loan` / `LoanTransactionWritePlatformService.java` | **New Interface** | Declares the contract for the 13 loan transaction methods (`makeLoanRepayment`, `adjustLoanTransaction`, `chargebackLoanTransaction`, etc.). | | `fineract-provider` / `LoanTransactionWritePlatformServiceImpl.java` | **New Service** | Implements the transaction write logic and internal helper routines. | | `fineract-provider` / `LoanWritePlatformServiceJpaRepositoryImpl.java` | **Refactor** | Injects `LoanTransactionWritePlatformService`, delegates transaction calls, removes 6 obsolete dependencies, and reduces class size by >800 lines. | | `fineract-provider` / `LoanAccountConfiguration.java` | **Configuration** | Registers the `LoanTransactionWritePlatformService` Spring bean definition. | | `fineract-provider` / `*Test.java` | **Testing** | Added unit tests in `LoanTransactionWritePlatformServiceImplTest` and 13 delegation tests in `LoanWritePlatformServiceJpaRepositoryImplTest`. | <details> <summary><b>Extracted Transaction Methods (13)</b></summary> 1. `makeGLIMLoanRepayment` 2. `makeLoanRepayment` 3. `makeLoanRepaymentWithChargeRefundChargeType` 4. `makeInterestPaymentWaiver` 5. `adjustLoanTransaction` 6. `chargebackLoanTransaction` 7. `waiveInterestOnLoan` 8. `recoverFromGuarantor` 9. `creditBalanceRefund` 10. `makeLoanRefund` 11. `makeRefund` 12. `makeManualInterestRefund` 13. `handleChargebackTransaction` *(Associated internal helper routines migrated: `recalculateLoanWithInterestPaymentWaiverTxn`, `reprocessChangedLoanTransactions`, `saveNote`, `validateLoanTransactionAmountChargeBack`, `waiveInterest`, `checkIfLoanIsPaidInAdvance`, `saveAndFlushLoanWithDataIntegrityViolationChecks`, `checkClientOrGroupActive`, `createNote`)*. </details> ## Checklist Please make sure these boxes are checked before submitting your pull request - thanks! - [x] Write the commit message as per [our guidelines](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#pull-requests) - [x] 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. - [x] Create/update [unit or integration tests](https://fineract.apache.org/docs/current/#_testing) for verifying the changes made. - [x] Follow our [coding conventions](https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions). - [x] 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 - [x] [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). - [x] If merging this PR resolves a JIRA issue, I will mark that issue as resolved and set "Fix Version/s" appropriately. - [x] I followed the [AI Policy](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#ai-policy). 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
