FINERACT-2421: Allow ProgressiveLoanInterestScheduleModel recalculation

Co-authored-by: Soma Sörös <soma.soros@dpc.hu>
This commit is contained in:
Adam Saghy
2026-02-13 14:58:37 +01:00
co-authored by Soma Sörös
parent a8fb5e7826
commit 6269cbbb79
26 changed files with 563 additions and 15 deletions
@@ -279,4 +279,10 @@ public interface LoanRepository extends JpaRepository<Loan, Long>, JpaSpecificat
@Query(FIND_ALL_LOANS_BEHIND_ON_DISBURSEMENT_DATE)
List<COBIdAndLastClosedBusinessDate> findAllLoansBehindOnDisbursementDate(@Param("cobBusinessDate") LocalDate cobBusinessDate,
@Param("loanIds") List<Long> loanIds, @Param("loanStatuses") Collection<LoanStatus> loanStatuses);
@Query("SELECT CASE WHEN COUNT(l) > 0 THEN TRUE ELSE FALSE END FROM Loan l WHERE l.id = :loanId and l.loanRepaymentScheduleDetail.loanScheduleType = org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType.PROGRESSIVE")
Boolean isProgressiveLoan(@Param("loanId") Long loanId);
@Query("SELECT CASE WHEN COUNT(l) > 0 THEN TRUE ELSE FALSE END FROM Loan l WHERE l.id = :loanId and l.loanStatus in :allowedLoanStatuses")
Boolean isLoanInAllowedStatus(@Param("loanId") Long loanId, @Param("allowedLoanStatuses") List<LoanStatus> allowedLoanStatuses);
}
@@ -313,4 +313,8 @@ public class LoanRepositoryWrapper {
public boolean isEnabledCapitalizedIncome(Long loanId) {
return repository.isEnabledCapitalizedIncome(loanId);
}
public boolean isLoanInAllowedStatus(Long loanId, List<LoanStatus> allowedLoanStatuses) {
return repository.isLoanInAllowedStatus(loanId, allowedLoanStatuses);
}
}