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


##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/repository/WorkingCapitalLoanBreachScheduleRepository.java:
##########
@@ -41,4 +43,22 @@ Optional<WorkingCapitalLoanBreachSchedule> 
findByLoanIdAndFromDateLessThanEqualA
             LocalDate transactionDate, LocalDate transactionDate1);
 
     Optional<WorkingCapitalLoanBreachSchedule> 
findTopByLoanIdAndBreachTrueOrderByFromDateAsc(Long loanId);
+
+    @Query("""
+            SELECT s FROM WorkingCapitalLoanBreachSchedule s
+            WHERE s.loan.id = :loanId
+              AND s.breach IS NULL
+              AND s.fromDate <= :businessDate
+              AND s.toDate >= :businessDate
+            ORDER BY s.periodNumber DESC""")
+    List<WorkingCapitalLoanBreachSchedule> 
findCurrentOpenPeriodsOrderByPeriodNumberDesc(@Param("loanId") Long loanId,

Review Comment:
   Its never more than 1 item, 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]

Reply via email to