adamsaghy commented on code in PR #6070:
URL: https://github.com/apache/fineract/pull/6070#discussion_r3520577403
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanBreachScheduleServiceImpl.java:
##########
@@ -290,6 +294,19 @@ public void recalculatePeriodsForPauses(final
WorkingCapitalLoan loan) {
effectivePauses.size());
}
+ @Override
+ public void reEvaluateAfterEnable(final WorkingCapitalLoan loan, final
LocalDate enableDate) {
+ final Optional<WorkingCapitalBreach> breachOpt = getBreachConfig(loan);
+ if (breachOpt.isEmpty()) {
+ return;
+ }
+ generateNextPeriodIfNeeded(loan, enableDate);
+ final List<WorkingCapitalLoanBreachSchedule> periods =
repository.findByLoanIdOrderByPeriodNumberAsc(loan.getId());
+ periods.stream().filter(period -> period.getBreach() ==
null).forEach(period -> recomputeBreach(period, enableDate));
Review Comment:
while breach is disabled, there should be no any logic which updates
anything on breach periods.
Nevertheless, reenable breach shall ensure to compute and update everything
till current date and actual state of repayments...which could easily mean,
reevaluate all transactions and breach periods.
--
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]