Skip to content

Conversation

@airajena
Copy link
Contributor

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 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 to verify that TRANSFER_IN_PROGRESS correctly transitions to ACTIVE or OVERPAID.

Testing

  • Added unit tests: testTransitionShouldWorkProperlyForLoanRepaymentOrWaiverWhenTransferInProgress and testTransitionShouldWorkProperlyForLoanOverpaymentWhenTransferInProgress.
  • Validated that existing tests pass.
  • Verified code quality with ./gradlew spotlessApply spotbugsMain spotbugsTest checkstyleMain checkstyleTest.

Related Issue

Fixes FINERACT-2050

Copy link
Contributor

@IOhacker IOhacker left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants