Aman-Mittal commented on code in PR #5195:
URL: https://github.com/apache/fineract/pull/5195#discussion_r2594836717
##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/AdvancedPaymentScheduleTransactionProcessor.java:
##########
@@ -590,48 +592,98 @@ private boolean chargeOffIsInEffect(TransactionCtx ctx,
LoanTransaction chargeOf
}
private void handleReAmortization(LoanTransaction loanTransaction,
TransactionCtx transactionCtx) {
- LocalDate transactionDate = loanTransaction.getTransactionDate();
- List<LoanRepaymentScheduleInstallment> previousInstallments =
transactionCtx.getInstallments().stream() //
+ final Loan loan = loanTransaction.getLoan();
Review Comment:
It would be much better if this can be broken up into multiple functions.
Logic has many if else branching
Please correct me if your current implementation based on this.
START
|
|-- Is the loan interest-bearing?
|
|-- NO → Use non-interest re-amortization logic → END
|
|-- YES
|
|-- Is interest handling type DEFAULT or missing?
| |
| |-- YES → Check recalculation rules
| | |
| | |-- Is this a Progressive transaction AND is
interest recalculation enabled?
| | | |
| | | |-- YES → call special
re-amortization method → END
| | |
| | |-- NO → Is interest recalculation disabled?
| | |
| | |-- YES → throw "not implemented" →
END
| | |
| | |-- NO → END (do nothing)
| |
|-- NO → throw "not implemented" for this interest strategy →
END
--
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]