FINERACT-2326: Reprocessing loan internal api for testing purpose

This commit is contained in:
Jose Alberto Hernandez
2025-09-16 15:11:55 +02:00
committed by Aleksandar Vidakovic
parent 23080c5041
commit 000ebb4c1d
16 changed files with 414 additions and 24 deletions
@@ -319,6 +319,9 @@ public class LoanTransaction extends AbstractAuditableWithUTCDateTimeCustom<Long
newTransaction.setLoanReAgeParameter(loanTransaction.getLoanReAgeParameter().getCopy(newTransaction));
}
newTransaction.setClassification(loanTransaction.getClassification());
if (loanTransaction.isAccrualActivity()) {
newTransaction.setCreatedBy(loanTransaction.getCreatedBy().get());
}
return newTransaction;
}
@@ -325,6 +325,17 @@ public interface LoanTransactionRepository extends JpaRepository<LoanTransaction
List<LoanTransaction> findNonReversedLoanAndTypeAndDates(@Param("loan") Loan loan, @Param("type") LoanTransactionType type,
@Param("transactionDates") Set<LocalDate> transactionDates);
@Query("""
SELECT lt FROM LoanTransaction lt
WHERE lt.loan = :loan
AND lt.reversed = false
AND lt.typeOf = :type
AND lt.dateOf = :transactionDate
ORDER BY lt.dateOf, lt.createdDate, lt.id
""")
List<LoanTransaction> findNonReversedLoanAndTypeAndDate(@Param("loan") Loan loan, @Param("type") LoanTransactionType type,
@Param("transactionDate") LocalDate transactionDate);
@Query("""
SELECT lt FROM LoanTransaction lt
WHERE lt.loan = :loan