oleksii-novikov-onix commented on code in PR #6205:
URL: https://github.com/apache/fineract/pull/6205#discussion_r3756599986
##########
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:
I have rechecked, it can never be more than one, so breach could return
`Optional`.
The delinquency schedule is built the same way, so the same change would
make sense there to keep the two in sync. What do you think?
--
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]