FINERACT-1724: Arrears configuration at loan creation is not considered correctly
This commit is contained in:
committed by
Adam Saghy
parent
dabe78d5dc
commit
b1af8a3f83
+2
-5
@@ -120,11 +120,8 @@ public class LoanDelinquencyDomainServiceImpl implements LoanDelinquencyDomainSe
|
||||
}
|
||||
|
||||
Integer graceDays = 0;
|
||||
if (loan.getLoanProduct().getLoanProductRelatedDetail().getGraceOnArrearsAgeing() != null) {
|
||||
graceDays = loan.getLoanProduct().getLoanProductRelatedDetail().getGraceOnArrearsAgeing();
|
||||
if (graceDays == null) {
|
||||
graceDays = 0;
|
||||
}
|
||||
if (loan.getLoanProductRelatedDetail().getGraceOnArrearsAgeing() != null) {
|
||||
graceDays = loan.getLoanProductRelatedDetail().getGraceOnArrearsAgeing();
|
||||
}
|
||||
log.debug("Loan id {} with overdue since date {} and outstanding amount {}", loan.getId(), overdueSinceDate, outstandingAmount);
|
||||
|
||||
|
||||
+2
@@ -1072,6 +1072,8 @@ final class LoansApiResourceSwagger {
|
||||
public LocalDate overpaidOnDate;
|
||||
@Schema(example = "false")
|
||||
public Boolean chargedOff;
|
||||
@Schema(example = "3")
|
||||
public Integer inArrearsTolerance;
|
||||
}
|
||||
|
||||
@Schema(description = "GetLoansResponse")
|
||||
|
||||
+2
@@ -1199,6 +1199,8 @@ final class LoanProductsApiResourceSwagger {
|
||||
public Integer dueDaysForRepaymentEvent;
|
||||
@Schema(example = "3")
|
||||
public Integer overDueDaysForRepaymentEvent;
|
||||
@Schema(example = "3")
|
||||
public Integer inArrearsTolerance;
|
||||
}
|
||||
|
||||
@Schema(description = "PutLoanProductsProductIdRequest")
|
||||
|
||||
+3
-6
@@ -112,8 +112,7 @@ public class LoanDelinquencyDomainServiceTest {
|
||||
|
||||
// when
|
||||
when(loanProductRelatedDetail.getGraceOnArrearsAgeing()).thenReturn(0);
|
||||
when(loanProduct.getLoanProductRelatedDetail()).thenReturn(loanProductRelatedDetail);
|
||||
when(loan.getLoanProduct()).thenReturn(loanProduct);
|
||||
when(loan.getLoanProductRelatedDetail()).thenReturn(loanProductRelatedDetail);
|
||||
when(loan.getRepaymentScheduleInstallments()).thenReturn(repaymentScheduleInstallments);
|
||||
when(loan.getCurrency()).thenReturn(currency);
|
||||
|
||||
@@ -137,8 +136,7 @@ public class LoanDelinquencyDomainServiceTest {
|
||||
|
||||
// when
|
||||
when(loanProductRelatedDetail.getGraceOnArrearsAgeing()).thenReturn(0);
|
||||
when(loanProduct.getLoanProductRelatedDetail()).thenReturn(loanProductRelatedDetail);
|
||||
when(loan.getLoanProduct()).thenReturn(loanProduct);
|
||||
when(loan.getLoanProductRelatedDetail()).thenReturn(loanProductRelatedDetail);
|
||||
when(loan.getRepaymentScheduleInstallments()).thenReturn(repaymentScheduleInstallments);
|
||||
when(loan.getLoanTransactions(Mockito.any(Predicate.class))).thenReturn(Collections.emptyList());
|
||||
when(loan.getLastLoanRepaymentScheduleInstallment()).thenReturn(repaymentScheduleInstallments.get(0));
|
||||
@@ -174,8 +172,7 @@ public class LoanDelinquencyDomainServiceTest {
|
||||
|
||||
// when
|
||||
when(loanProductRelatedDetail.getGraceOnArrearsAgeing()).thenReturn(0);
|
||||
when(loanProduct.getLoanProductRelatedDetail()).thenReturn(loanProductRelatedDetail);
|
||||
when(loan.getLoanProduct()).thenReturn(loanProduct);
|
||||
when(loan.getLoanProductRelatedDetail()).thenReturn(loanProductRelatedDetail);
|
||||
when(loan.getRepaymentScheduleInstallments()).thenReturn(repaymentScheduleInstallments);
|
||||
when(loan.getCurrency()).thenReturn(currency);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user