mariiaKraievska commented on code in PR #4819:
URL: https://github.com/apache/fineract/pull/4819#discussion_r2177381218
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAccrualActivityProcessingServiceImpl.java:
##########
@@ -195,9 +195,10 @@ public void processAccrualActivityForLoanReopen(final
@NonNull Loan loan) {
return isDueBefore && isAfterOrEqualToLastAccrualDate;
}).sorted(Comparator.comparing(LoanRepaymentScheduleInstallment::getDueDate)).toList();
- installments.forEach(installment -> {
Review Comment:
Setting lastAccrualActivityMarkedToReverse = Optional.empty(); ensures that
only the first installment in the loop uses the original value of
lastAccrualActivityMarkedToReverse. For all subsequent installments, it will be
empty, so they will not be treated as a replay of the previous accrual
activity, but as new accrual activities.
This is necessary to publish the correct business event: only the first
accrual activity after loan reopen should be a replay, and the rest should be
new.
By the way, this line (lastAccrualActivityMarkedToReverse =
Optional.empty();) was actually present in the original implementation, but it
seems it got lost during a recent refactoring :(
--
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]