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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargeWritePlatformServiceImpl.java:
##########
@@ -305,7 +306,7 @@ public CommandProcessingResult addLoanCharge(final Long 
loanId, final JsonComman
             } else {
                 reprocessLoanTransactionsService.reprocessTransactions(loan);
             }
-            loan.doPostLoanTransactionChecks(transactionDate, 
loan.getLoanLifecycleStateMachine());
+            defaultLoanLifecycleStateMachine.doPostLoanTransactionChecks(loan, 
transactionDate);

Review Comment:
   Can we rewrite these actions to reflect the correct EVENT?
   Adding a loan charge should not trigger loan status with "LOAN REPAYMENT OR 
WAIVER" event... which is the default fallback behaviour....
   
   Either `defaultLoanLifecycleStateMachine` should be clever to figure out 
what to do based on the actual loan state or we can try to give it some context 
as what event occurred, and event + loan state to control loan status changes 
behaviour.
   
   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]

Reply via email to