FINERACT-2455: Rework transaction reprocessing#6151
Conversation
e1ec3f1 to
3106cf9
Compare
| public WorkingCapitalLoanTransactionAllocation apply(final WorkingCapitalLoanTransaction transaction, | ||
| final WorkingCapitalLoanTransactionAllocation existingAllocation, final WorkingCapitalLoanAllocationPlan plan, | ||
| final Map<Long, WorkingCapitalLoanCharge> chargesById) { | ||
| public Result apply(final WorkingCapitalLoanTransaction transaction, final WorkingCapitalLoanTransactionAllocation existingAllocation, |
There was a problem hiding this comment.
Minor:
2nd parameter can be lifted.
Assumption:
transaction.getAllocation() should give the same.
There was a problem hiding this comment.
Updated the code, the original issue that made the "existingAllocation" parameter mandatory, was that the applier only linked the transaction to the allocation, it didn't set the inverse. So a newly created transaction that just had it's allocation applied returned a stale "null" when txn.getAllocation() was called.
I updated the org.apache.fineract.portfolio.workingcapitalloan.domain.WorkingCapitalLoanTransactionAllocation#forPortions method to make the link both ways. This also simplified the logic a bit in the reprocessor.
| int replayOrder(); | ||
| } | ||
|
|
||
| private record PaymentEvent(LocalDate date, BigDecimal amount) implements ScheduleEvent { |
There was a problem hiding this comment.
On progressive loans we were tie breaking based on creation date time.
There was a problem hiding this comment.
Changed it to more closely match LoanTransactionComparator behaviour
3106cf9 to
29299d4
Compare
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.