FINERACT-2421: Manual interest refund on closed loan generates exception#5363
Merged
adamsaghy merged 2 commits intoapache:developfrom Jan 23, 2026
Conversation
adamsaghy
reviewed
Jan 22, 2026
| loanAccrualsProcessingService.reprocessExistingAccruals(loan, true); | ||
| loanAccrualsProcessingService.processIncomePostingAndAccruals(loan, true); | ||
| } | ||
| loanLifecycleStateMachine.determineAndTransition(loan, interestRefundTxn.getTransactionDate()); |
Contributor
There was a problem hiding this comment.
this seems odd for fixing the issue. Can you please elaborate why this helps?
Contributor
Author
There was a problem hiding this comment.
The DatabaseException was because in the AccrualActivity process, the closureDate was set in null because the loanBalanceService.isOverPaid(loan) return true but the Loan instance was not set as Overpaid status
LocalDate closureDate = loanBalanceService.isOverPaid(loan) ? loan.getOverpaidOnDate() : loan.getClosedOnDate();
So, If we set the Loan transition we are ensuring the Loan has the right status and this case the OverpaidOnDate value need to set the closureDate
Aman-Mittal
approved these changes
Jan 22, 2026
…ed loan generates exception
832ff4c to
4ffcf3f
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
We have run into a bug with creating manual interest refunds for Loan accounts. Upon creating a manual interest refund for a loan in 600 (CLOSED_OBLIGATIONS_MET) status, we are receiving a 403
DatabaseExceptionbecause the Accrual Activity transaction was being created with transaction date in nullFINERACT-2421
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.