adamsaghy commented on code in PR #2777:
URL: https://github.com/apache/fineract/pull/2777#discussion_r1037943155
##########
fineract-provider/src/main/java/org/apache/fineract/cob/service/InlineLoanCOBExecutorServiceImpl.java:
##########
@@ -120,6 +132,19 @@ public void execute(List<Long> loanIds, String jobName) {
}
}
+ private LocalDate getOldestCOBBusinessDate(List<Long> loanIds) {
+ return loanRepository.findOldestCOBProcessedLoanByLoanIds(loanIds)
+
.orElse(ThreadLocalContextUtil.getBusinessDateByType(BusinessDateType.COB_DATE).minusDays(1));
+ }
+
+ private List<Long> getLoanIdsTOBeProcessed(List<Long> loanIds, LocalDate
oldestCOBBusinessDate, LocalDate cobBusinessDate) {
+ if (!oldestCOBBusinessDate.isBefore(cobBusinessDate)) {
+ return Collections.emptyList();
+ } else {
+ return
loanRepository.findAllNonClosedLoanIdsOneDayBehindByLoanIds(cobBusinessDate,
loanIds);
Review Comment:
Is this correct? Why do we fetch only the loans that one day behind? We
should fetch all of them, no?
--
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]