mariiaKraievska commented on code in PR #6070:
URL: https://github.com/apache/fineract/pull/6070#discussion_r3520563766
##########
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:
On enable we only recomputeBreach for periods where breach == null. If a
repayment during disable had already set breach = false, would those periods be
skipped incorrectly? Should we consider recomputing all periods up to
enableDate, not only those with a null breach flag?
--
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]