budaidev commented on code in PR #4629:
URL: https://github.com/apache/fineract/pull/4629#discussion_r2065713704
##########
fineract-provider/src/main/java/org/apache/fineract/cob/loan/LoanInterestRecalculationCOBBusinessStep.java:
##########
@@ -43,16 +46,48 @@ public Loan execute(Loan loan) {
return loan;
}
- log.debug("Start processing loan interest recalculation [{}]",
loan.getId());
-
ThreadLocalContextUtil.setActionContext(ActionContext.DEFAULT);
+ // Overdue installment check
+ LocalDate businessDate = DateUtils.getBusinessLocalDate();
+ if (!hasOverdueInstallment(loan, businessDate)) {
+ log.debug("Skip loan interest recalculation [{}] - No overdue
installments.", loan.getId());
+ return loan;
+ }
- loan = loanWritePlatformService.recalculateInterest(loan);
+ log.debug("Start processing loan interest recalculation [{}]",
loan.getId());
+ try {
+ loan = loanWritePlatformService.recalculateInterest(loan);
Review Comment:
I don't think we are expecting any errors during the checking phase, but you
are right it is safer to put everything in the try catch just to make sure.
--
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]