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


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanDisbursementDetailsIntegrationTest.java:
##########
@@ -483,4 +473,24 @@ private HashMap<String, String> collaterals(Integer 
collateralId, BigDecimal qua
         return collateral;
     }
 
+    public void 
evaluateEqualInstallmentsForRepaymentSchedule(GetLoansLoanIdRepaymentSchedule 
getLoanRepaymentSchedule, Double limit) {
+        Double totalOutstandingForPeriod = 0.0;
+        Double totalInstallmentAmountForPeriod = 0.0;
+        if (getLoanRepaymentSchedule != null) {
+            log.info("Loan with {} periods", 
getLoanRepaymentSchedule.getPeriods().size());
+            for (GetLoansLoanIdRepaymentPeriod period : 
getLoanRepaymentSchedule.getPeriods()) {
+                if (period.getPeriod() != null) {
+                    log.info("Period number {} for due date {} and outstanding 
{} {}", period.getPeriod(), period.getDueDate(),
+                            period.getTotalOutstandingForPeriod(), 
period.getTotalInstallmentAmountForPeriod());
+                    if (period.getPeriod() == 1) {
+                        totalOutstandingForPeriod = 
period.getTotalOutstandingForPeriod();
+                        totalInstallmentAmountForPeriod = 
period.getTotalInstallmentAmountForPeriod();
+                    } else {
+                        
assertTrue(Math.abs(period.getTotalOutstandingForPeriod() - 
totalOutstandingForPeriod) <= limit);

Review Comment:
   @josehernandezfintecheandomx Can you help me to understand why do we need 
"limit" to be introduced? In my understanding if we are testing whether the 
instalment amounts are equal or not... if there is any fractions still it 
should remains +-1, no?



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