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


##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/interestpauses/service/InterestPauseWritePlatformServiceImpl.java:
##########
@@ -113,15 +112,17 @@ public CommandProcessingResult updateInterestPause(Long 
loanId, Long variationId
                 .with(Map.of("startDate", startDate.toString(), "endDate", 
endDate.toString())).build();
     }
 
-    private CommandProcessingResult processInterestPause(Supplier<Loan> 
loanSupplier, LocalDate startDate, LocalDate endDate,
+    private CommandProcessingResult processInterestPause(final Loan loan, 
final LocalDate startDate, final LocalDate endDate,
             String dateFormat, String locale) {
-        final Loan loan = loanSupplier.get();
-
         validateInterestPauseDates(loan, startDate, endDate, dateFormat, 
locale);
 
-        LoanTermVariations variation = new 
LoanTermVariations(INTEREST_PAUSE.getValue(), startDate, null, endDate, false, 
loan);
+        final LoanTermVariations variation = new 
LoanTermVariations(INTEREST_PAUSE.getValue(), startDate, BigDecimal.ZERO, 
endDate, false,
+                loan);
+
+        final LoanTermVariations savedVariation = 
loanTermVariationsRepository.saveAndFlush(variation);
 
-        LoanTermVariations savedVariation = 
loanTermVariationsRepository.saveAndFlush(variation);
+        loan.setHelpers(null, 
loanRepaymentScheduleTransactionProcessorFactory);

Review Comment:
   Edge case, but it might after the interest pause the loan goes to CLOSED or 
OVERPAID... you can never know. So setting all the helper would be favourable 
and cause no issues.



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