oleksii-novikov-onix commented on code in PR #6070:
URL: https://github.com/apache/fineract/pull/6070#discussion_r3529507214
##########
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:
Fixed
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/validator/WorkingCapitalLoanBreachActionParseAndValidator.java:
##########
@@ -87,6 +89,7 @@ public WorkingCapitalLoanBreachAction validateAndParse(final
JsonCommand command
validateLoanIsActive(dataValidator, workingCapitalLoan);
validateBreachConfigurationExists(dataValidator, workingCapitalLoan);
+ validateBreachNotDisabled(dataValidator, workingCapitalLoan.getId());
Review Comment:
Fixed
--
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]