airajena opened a new pull request, #5383: URL: https://github.com/apache/fineract/pull/5383
## Description This PR fixes an issue where loans attached to a client remain in `TRANSFER_IN_PROGRESS` status after the client is successfully transferred to a new branch and the transfer is accepted. Since the loan was active in the previous branch, it should return to `ACTIVE` status in the new branch. ## Changes - Updated [DefaultLoanLifecycleStateMachine](cci:2://file:///c:/Users/airaj/OneDrive/Desktop/gsoc/fineract/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/DefaultLoanLifecycleStateMachine.java:32:0-384:1) to allow transitions from `TRANSFER_IN_PROGRESS` to `ACTIVE` (for normal loans) and `OVERPAID` (for overpaid loans). - These transitions are triggered by `LOAN_REPAYMENT_OR_WAIVER` or `LOAN_OVERPAYMENT` events, which occur during the client transfer acceptance process. - Added comprehensive unit tests in [DefaultLoanLifecycleStateMachineTest](cci:2://file:///c:/Users/airaj/OneDrive/Desktop/gsoc/fineract/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/domain/DefaultLoanLifecycleStateMachineTest.java:45:0-458:1) to verify that `TRANSFER_IN_PROGRESS` correctly transitions to `ACTIVE` or `OVERPAID`. ## Testing - Added unit tests: [testTransitionShouldWorkProperlyForLoanRepaymentOrWaiverWhenTransferInProgress](cci:1://file:///c:/Users/airaj/OneDrive/Desktop/gsoc/fineract/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/domain/DefaultLoanLifecycleStateMachineTest.java:423:4-440:5) and [testTransitionShouldWorkProperlyForLoanOverpaymentWhenTransferInProgress](cci:1://file:///c:/Users/airaj/OneDrive/Desktop/gsoc/fineract/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/domain/DefaultLoanLifecycleStateMachineTest.java:442:4-451:5). - Validated that existing tests pass. - Verified code quality with `./gradlew spotlessApply spotbugsMain spotbugsTest checkstyleMain checkstyleTest`. ## Related Issue Fixes FINERACT-2050 -- 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]
