FINERACT-2455: Working Capital Loan Transaction Undo - Generic#5937
Draft
somasorosdpc wants to merge 1 commit into
Draft
FINERACT-2455: Working Capital Loan Transaction Undo - Generic#5937somasorosdpc wants to merge 1 commit into
somasorosdpc wants to merge 1 commit into
Conversation
153fdcd to
e393d96
Compare
6 tasks
e393d96 to
91dbe49
Compare
adamsaghy
reviewed
Jun 10, 2026
| generated during loan approval/disbursement from the loan and product data.""") | ||
| @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK"), | ||
| @ApiResponse(responseCode = "404", description = "Working Capital Loan not found") }) | ||
| @Deprecated(forRemoval = true) |
Contributor
There was a problem hiding this comment.
We have repayment, no need for this.
Should be deleted
adamsaghy
reviewed
Jun 10, 2026
| throw new IllegalStateException("payment not found: date=" + paymentDate + " with amount=" + amount); | ||
| } | ||
| actualPayments.remove(first.get()); | ||
| rebuildPayments(); |
Contributor
There was a problem hiding this comment.
No need to rebuild everything... just the things after this operation...
adamsaghy
reviewed
Jun 10, 2026
| WorkingCapitalLoanConstants.paymentDetailsParamName, WorkingCapitalLoanConstants.externalIdParameterName, | ||
| WorkingCapitalLoanConstants.discountExternalIdParameterName, WorkingCapitalLoanConstants.classificationIdParamName)); | ||
|
|
||
| private static final Set<String> UNDO_TRANSACTION_SUPPORTED_PARAMETERS = new HashSet<>(Arrays.asList("locale", "dateFormat", |
Contributor
There was a problem hiding this comment.
id there is no transaction date or any other date, dateFormat parameter is not needed
adamsaghy
reviewed
Jun 10, 2026
| .orElseThrow(() -> new IllegalStateException("Projected amortization schedule is not found for loan " + loan.getId())); | ||
|
|
||
| model.undoPayment(transactionDate, repaymentAmount); | ||
| model.recalculateNetAmortizationAndDeferredBalanceFrom(transactionDate); |
Contributor
There was a problem hiding this comment.
This should not be standalone operation but as side-effect of model.undoPayment
adamsaghy
reviewed
Jun 10, 2026
| period.setBreach(null); | ||
| } | ||
| } | ||
| repository.saveAndFlush(period); |
adamsaghy
reviewed
Jun 10, 2026
| period.setDelinquentAmount(null); | ||
| period.setDelinquentDays(null); | ||
| } | ||
| loanDelinquencyRangeScheduleRepository.saveAndFlush(period); |
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
Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)
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.