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


##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanTransactionService.java:
##########
@@ -56,4 +66,37 @@ private Predicate<LoanTransaction> 
loanTransactionForReprocessingPredicate() {
                         || !transaction.isNonMonetaryTransaction() || 
transaction.isContractTermination());
     }
 
+    @Transactional(readOnly = true)
+    public boolean hasChargeOffTransaction(final Loan loan) {
+        return loanTransactionRepository.hasChargeOffTransaction(loan);
+    }
+
+    @Transactional(readOnly = true)
+    public boolean hasContractTerminationTransaction(final Loan loan) {
+        return 
loanTransactionRepository.hasContractTerminationTransaction(loan);
+    }
+
+    @Transactional(readOnly = true)
+    public boolean shouldRegenerateRepaymentSchedule(final Loan loan) {
+        final boolean hasChargeOffTransaction = hasChargeOffTransaction(loan);

Review Comment:
   We can improve and check in 1 query whether charge-off or contract 
termination transaction exists... calling twice is not the best for performance.



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