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


##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/data/ProgressiveLoanInterestScheduleModel.java:
##########
@@ -260,7 +260,7 @@ private void insertInterestPausePeriods(final 
RepaymentPeriod repaymentPeriod, f
 
         if (fromDate.isBefore(originalFromDate) && 
endDate.isBefore(originalDueDate)) {
             repaymentPeriod.getInterestPeriods().clear();

Review Comment:
   I am having concerns regarding 
`repaymentPeriod.getInterestPeriods().clear();`. If we want to insert a new 
interest period we should not remove all the existing ones!
   
   In my understanding we either:
   - insert new interest (pause) period as the very 1st interest period if the 
from date equals to the repayment period from date. If there were existing 
interest period which overlaps with the new interest (pause) period then if 
that overlapping interest period due date is before or equal with the new 
interest (pause) period due date then the existing interest period can be 
removed. If the existing, overlapping interest period due date is later than 
the new interest (pause) period due date then the existing interest period from 
date needs to be updated with the new interest (pause) period due date.
   If the new interest (pause) period from date is later then any of the 
existing interest period from date, then find the latest (based on from date) 
interest period,  and update its due date with the new interest (pause) period 
from date and insert after the existing interest period in the interest periods 
list. Similarly if there is any existing interest period that fully overlaps 
with the new interest (pause) period (from date is equal or after, due date is 
before or equal), that existing interest period can be removed.
   
   Kindly review my understanding and let me know your thoughts!



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