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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/ReprocessLoanTransactionsServiceImpl.java:
##########
@@ -85,13 +85,19 @@ public void reprocessTransactionsWithoutChecks(final Loan 
loan, final List<LoanT
         reprocessTransactionsAndFetchChangedTransactions(loan, transactions);
     }
 
+    @Override
+    public boolean shouldReprocessLoan(final Loan loan) {
+        return loan.isProgressiveSchedule() && 
interestScheduleModelRepositoryWrapper.findOneByLoan(loan).isEmpty();
+    }
+
     @Override
     public void processLatestTransaction(final LoanTransaction 
loanTransaction, final Loan loan) {
         LoanRepaymentScheduleTransactionProcessor transactionProcessor = 
loanTransactionProcessingService
                 
.getTransactionProcessor(loan.getTransactionProcessingStrategyCode());
 
         TransactionCtx transactionCtx;
         if (transactionProcessor instanceof 
AdvancedPaymentScheduleTransactionProcessor) {
+            // Fixed: prevented to use it without a model. shouldReprocessLoan 
used for it.

Review Comment:
   You can remove this



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/ReprocessLoanTransactionsServiceImpl.java:
##########
@@ -124,6 +130,8 @@ public void processLatestTransaction(final LoanTransaction 
loanTransaction, fina
 
     @Override
     public void updateModel(Loan loan) {
+        // recalculate the model if it is incorrect, it is used by WRITE 
operations
+        // Fixed on caller side

Review Comment:
   You can remove this.



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