You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by GitBox <gi...@apache.org> on 2022/11/16 10:07:18 UTC

[GitHub] [fineract] adamsaghy commented on a diff in pull request #2745: FINERACT-1734-Repayment-due-event

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


##########
fineract-provider/src/main/java/org/apache/fineract/cob/loan/CheckLoanRepaymentOverdueBusinessStep.java:
##########
@@ -19,33 +19,30 @@
 package org.apache.fineract.cob.loan;
 
 import java.time.LocalDate;
-import java.util.Collection;
+import java.util.List;
 import lombok.RequiredArgsConstructor;
 import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService;
 import org.apache.fineract.infrastructure.core.service.DateUtils;
 import org.apache.fineract.infrastructure.event.business.domain.loan.LoanRepaymentOverdueBusinessEvent;
 import org.apache.fineract.infrastructure.event.business.service.BusinessEventNotifierService;
 import org.apache.fineract.portfolio.loanaccount.domain.Loan;
-import org.apache.fineract.portfolio.loanaccount.loanschedule.data.OverdueLoanScheduleData;
-import org.apache.fineract.portfolio.loanaccount.service.LoanReadPlatformService;
+import org.apache.fineract.portfolio.loanaccount.domain.LoanRepaymentScheduleInstallment;
 import org.springframework.stereotype.Component;
 
 @Component
 @RequiredArgsConstructor
 public class CheckLoanRepaymentOverdueBusinessStep implements LoanCOBBusinessStep {
 
-    private final LoanReadPlatformService loanReadPlatformService;
     private final ConfigurationDomainService configurationDomainService;
     private final BusinessEventNotifierService businessEventNotifierService;
 
     @Override
     public Loan execute(Loan loan) {
         Long numberOfDaysAfterDueDateToRaiseEvent = configurationDomainService.retrieveRepaymentOverdueDays();
         final LocalDate currentDate = DateUtils.getBusinessLocalDate();
-        final Collection<OverdueLoanScheduleData> overdueInstallmentsForLoan = loanReadPlatformService
-                .retrieveAllOverdueInstallmentsForLoan(loan);
-        for (OverdueLoanScheduleData overdueInstallment : overdueInstallmentsForLoan) {
-            LocalDate installmentDueDate = LocalDate.parse(overdueInstallment.getDueDate());
+        final List<LoanRepaymentScheduleInstallment> loanRepaymentScheduleInstallments = loan.getRepaymentScheduleInstallments();

Review Comment:
   Can you help me to understand why the retrieveAllOverdueInstallmentsForLoan() was not sufficient? (i guess it was used to handle the grace period as well)



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org