mariiaKraievska commented on code in PR #4236:
URL: https://github.com/apache/fineract/pull/4236#discussion_r1899446562


##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java:
##########
@@ -3569,4 +3569,8 @@ public LoanRepaymentScheduleTransactionProcessor 
getTransactionProcessor() {
     public boolean isProgressiveSchedule() {
         return getLoanProductRelatedDetail().getLoanScheduleType() == 
PROGRESSIVE;
     }
+
+    public boolean isTransactionBeforeChargeOff(final boolean isChargedOff) {
+        return !isChargedOff || 
!LoanChargeOffBehaviour.ZERO_INTEREST.equals(this.getLoanProductRelatedDetail().getChargeOffBehaviour());

Review Comment:
   This condition 
`!LoanChargeOffBehaviour.ZERO_INTEREST.equals(this.getLoanProductRelatedDetail().getChargeOffBehaviour())`
 was added as a safeguard for future scenarios where someone might set 
`isChargedOff` to `true` when the `chargeOffBehaviour` is not `ZERO_INTEREST`.
   
   By including this specific check, we avoid potential issues where the logic 
could break or produce unexpected results due to changes or incorrect 
assumptions about the relationship between `chargeOffBehaviour` and the 
`isChargedOff` flag. Replacing this with `!ctx.isChargedOff()` could simplify 
the code but would remove this safeguard, potentially introducing bugs if this 
edge case arises.



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