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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepository.java:
##########
@@ -72,14 +73,20 @@ public interface LoanRepository extends JpaRepository<Loan, 
Long>, JpaSpecificat
 
     String FIND_ALL_NON_CLOSED = "select loan.id from Loan loan where 
loan.loanStatus in (100,200,300,303,304)";
 
-    String FIND_ALL_NON_CLOSED_ONE_DAY_BEHIND = "select loan.id from Loan loan 
where loan.loanStatus in (100,200,300,303,304) and (:last_closed_business_date 
= loan.lastClosedBusinessDate or loan.lastClosedBusinessDate is NULL)";
+    String FIND_ALL_NON_CLOSED_ONE_DAY_BEHIND = "select loan.id from Loan loan 
where loan.loanStatus in (100,200,300,303,304) and (:businessDate = 
loan.lastClosedBusinessDate or loan.lastClosedBusinessDate is NULL)";
 
     String FIND_NON_CLOSED_LOAN_THAT_BELONGS_TO_CLIENT = "select loan from 
Loan loan where loan.id = :loanId and loan.loanStatus = 300 and loan.client.id 
= :clientId";
 
     String FIND_BY_ACCOUNT_NUMBER = "select loan from Loan loan where 
loan.accountNumber = :accountNumber";
 
     String FIND_ID_BY_EXTERNAL_ID = "SELECT loan.id FROM Loan loan WHERE 
loan.externalId = :externalId";
 
+    String FIND_OLDEST_COB_PROCESSED_LOAN = "select loan from Loan loan where 
loan.lastClosedBusinessDate = (select min(l.lastClosedBusinessDate) from Loan 
l)";

Review Comment:
   Should it consider loan status? (only pick up active ones?)



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