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


##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/delinquency/helper/DelinquencyEffectivePauseHelperImpl.java:
##########
@@ -93,11 +93,17 @@ public Long 
getPausedDaysWithinRange(List<LoanDelinquencyActionData> effectiveDe
     private Optional<LoanDelinquencyAction> 
findMatchingResume(LoanDelinquencyAction pause, List<LoanDelinquencyAction> 
resumes) {
         if (resumes != null && !resumes.isEmpty()) {
             for (LoanDelinquencyAction resume : resumes) {
-                if (!pause.getStartDate().isAfter(resume.getStartDate()) && 
!resume.getStartDate().isAfter(pause.getEndDate())) {
+                if (isCreatedBefore(pause, resume) && 
!pause.getStartDate().isAfter(resume.getStartDate())
+                        && !resume.getStartDate().isAfter(pause.getEndDate())) 
{
                     return Optional.of(resume);
                 }
             }
         }
         return Optional.empty();
     }
+
+    // Without ids the creation order is unknown, so the resume applies to any 
pause containing its date.
+    private boolean isCreatedBefore(LoanDelinquencyAction pause, 
LoanDelinquencyAction resume) {

Review Comment:
   Nit: in production every action passed here comes from 
`findByLoanOrderById`, so ids are never null. The null fallback only exists for 
test fixtures built without ids. Could we give those fixtures ids and simplify 
this to `pause.getId() < resume.getId()`? Then production code doesn't carry a 
branch just for the tests.



##########
fineract-e2e-tests-runner/src/test/resources/features/LoanRepayment-Part4.feature:
##########
@@ -397,7 +397,7 @@ Feature: LoanRepayment - Part4
       | Principal due | Interest | Fees | Penalties | Due    | Paid  | In 
advance | Late | Outstanding |
       | 1000.0        | 0.0      | 0.0  | 0.0       | 1000.0 | 250.0 | 0.0     
   | 0.0  | 750.0       |
 
-  @TestRailId:CXXXX @AdvancedPaymentAllocation @ProgressiveLoanSchedule
+  @TestRailId:C115397 @AdvancedPaymentAllocation @ProgressiveLoanSchedule

Review Comment:
   Nit: this TestRail id change is unrelated to this PR. Better in a separate 
commit.



##########
fineract-e2e-tests-runner/src/test/resources/features/LoanBuyDownFees.feature:
##########
@@ -4079,11 +4079,7 @@ Feature: Buy Down Fees
     When Loan Pay-off is made on "16 April 2024"
     Then Loan is closed with zero outstanding balance and it's all 
installments have obligations met
 
-
-
-    ##
-  ## ISSUE:   Buydown amortizes slower after waiver-reversal
-  @TestRailId:CXXXX
+  @TestRailId:C115396

Review Comment:
   This change isn't related to FINERACT-2455, and it also drops the `ISSUE: 
Buydown amortizes slower after waiver-reversal` note. Is that issue resolved? 
If not, could we keep the note and move the TestRail id assignment into a 
separate commit/PR?



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