adamsaghy commented on code in PR #2777:
URL: https://github.com/apache/fineract/pull/2777#discussion_r1037944537


##########
fineract-provider/src/main/java/org/apache/fineract/cob/service/InlineLoanCOBExecutorServiceImpl.java:
##########
@@ -96,6 +97,19 @@ public CommandProcessingResult executeInlineJob(JsonCommand 
command, String jobN
 
     @Override
     public void execute(List<Long> loanIds, String jobName) {
+        LocalDate oldestCOBBusinessDate = getOldestCOBBusinessDate(loanIds);
+        LocalDate cobBusinessDate = 
ThreadLocalContextUtil.getBusinessDateByType(BusinessDateType.COB_DATE);
+        List<Long> loanIdsToBeProcessed = getLoanIdsTOBeProcessed(loanIds, 
oldestCOBBusinessDate, cobBusinessDate);
+        if (!loanIdsToBeProcessed.isEmpty()) {
+            LocalDate executingBusinessDate = 
oldestCOBBusinessDate.plusDays(1);
+            while (!executingBusinessDate.isAfter(cobBusinessDate)) {
+                execute(loanIdsToBeProcessed, jobName, executingBusinessDate);

Review Comment:
   The loanIdsToBeProcessed is not ordered. if the loan last cob date is not 
the same (1-5 days before the actual COB date), how it would now to not run the 
job for loans which are already processed for that particular day?



-- 
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]

Reply via email to