FINERACT-2181: Fix integration test / unify getLoanRepaymentScheduleDetail()
This commit is contained in:
+3
-7
@@ -667,10 +667,6 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom<Long> {
|
||||
return this.loanProduct;
|
||||
}
|
||||
|
||||
public LoanProductRelatedDetail repaymentScheduleDetail() {
|
||||
return this.loanRepaymentScheduleDetail;
|
||||
}
|
||||
|
||||
public void updateClient(final Client client) {
|
||||
this.client = client;
|
||||
}
|
||||
@@ -1347,7 +1343,7 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom<Long> {
|
||||
}
|
||||
|
||||
public Money getTotalOverpaidAsMoney() {
|
||||
return Money.of(this.repaymentScheduleDetail().getCurrency(), this.totalOverpaid);
|
||||
return Money.of(this.getLoanProductRelatedDetail().getCurrency(), this.totalOverpaid);
|
||||
}
|
||||
|
||||
public void updateIsInterestRecalculationEnabled() {
|
||||
@@ -1512,7 +1508,7 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom<Long> {
|
||||
|
||||
public boolean isFeeCompoundingEnabledForInterestRecalculation() {
|
||||
boolean isEnabled = false;
|
||||
if (this.repaymentScheduleDetail().isInterestRecalculationEnabled()) {
|
||||
if (this.getLoanProductRelatedDetail().isInterestRecalculationEnabled()) {
|
||||
isEnabled = this.loanInterestRecalculationDetails.getInterestRecalculationCompoundingMethod().isFeeCompoundingEnabled();
|
||||
}
|
||||
return isEnabled;
|
||||
@@ -1602,7 +1598,7 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom<Long> {
|
||||
}
|
||||
return numberOfInstallments;
|
||||
}
|
||||
return this.repaymentScheduleDetail().getNumberOfRepayments() + adjustNumberOfRepayments();
|
||||
return this.getLoanProductRelatedDetail().getNumberOfRepayments() + adjustNumberOfRepayments();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@ public class LoanTermVariationsMapper {
|
||||
CalendarHistoryDataWrapper calendarHistoryDataWrapper;
|
||||
RepaymentStartDateType repaymentStartDateType = loan.getLoanProduct().getRepaymentStartDateType();
|
||||
boolean allowCompoundingOnEod = false;
|
||||
if (loan.repaymentScheduleDetail().isInterestRecalculationEnabled()) {
|
||||
if (loan.getLoanProductRelatedDetail().isInterestRecalculationEnabled()) {
|
||||
restCalendarInstance = scheduleGeneratorDTO.getCalendarInstanceForInterestRecalculation();
|
||||
compoundingCalendarInstance = scheduleGeneratorDTO.getCompoundingCalendarInstance();
|
||||
recalculationFrequencyType = loan.getLoanInterestRecalculationDetails().getRestFrequencyType();
|
||||
|
||||
+1
-1
@@ -179,7 +179,7 @@ public class LoanDownPaymentHandlerServiceImpl implements LoanDownPaymentHandler
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
final BigDecimal totalPrincipalCredited = totalDisbursed.add(totalPrincipalAdjusted).add(totalCapitalizedIncome);
|
||||
if (totalPrincipalCredited.compareTo(loan.getSummary().getTotalPrincipalRepaid()) < 0
|
||||
&& loan.repaymentScheduleDetail().getPrincipal().minus(totalDisbursed).isGreaterThanZero()) {
|
||||
&& loan.getLoanProductRelatedDetail().getPrincipal().minus(totalDisbursed).isGreaterThanZero()) {
|
||||
final String errorMessage = "The transaction amount cannot exceed threshold.";
|
||||
throw new InvalidLoanStateTransitionException("transaction", "amount.exceeds.threshold", errorMessage);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user