tidy up properties not used at present on commands.
This commit is contained in:
@@ -23,8 +23,6 @@ public class CalculateLoanScheduleCommand {
|
||||
private Integer amortizationMethod;
|
||||
private Integer interestMethod;
|
||||
private Integer interestCalculationPeriodMethod;
|
||||
private boolean flexibleRepaymentSchedule = false;
|
||||
private boolean interestRebateAllowed = false;
|
||||
|
||||
private LocalDate expectedDisbursementDate;
|
||||
private LocalDate repaymentsStartingFromDate;
|
||||
@@ -52,8 +50,6 @@ public class CalculateLoanScheduleCommand {
|
||||
this.repaymentFrequency = repaymentFrequency;
|
||||
this.numberOfRepayments = numberOfRepayments;
|
||||
this.amortizationMethod = amortizationMethod;
|
||||
this.flexibleRepaymentSchedule = false;
|
||||
this.interestRebateAllowed = false;
|
||||
|
||||
this.expectedDisbursementDate = expectedDisbursementDate;
|
||||
this.repaymentsStartingFromDate = repaymentsStartingFromDate;
|
||||
@@ -157,22 +153,6 @@ public class CalculateLoanScheduleCommand {
|
||||
this.interestCalculationPeriodMethod = interestCalculationPeriodMethod;
|
||||
}
|
||||
|
||||
public boolean isFlexibleRepaymentSchedule() {
|
||||
return flexibleRepaymentSchedule;
|
||||
}
|
||||
|
||||
public void setFlexibleRepaymentSchedule(boolean flexibleRepaymentSchedule) {
|
||||
this.flexibleRepaymentSchedule = flexibleRepaymentSchedule;
|
||||
}
|
||||
|
||||
public boolean isInterestRebateAllowed() {
|
||||
return interestRebateAllowed;
|
||||
}
|
||||
|
||||
public void setInterestRebateAllowed(boolean interestRebateAllowed) {
|
||||
this.interestRebateAllowed = interestRebateAllowed;
|
||||
}
|
||||
|
||||
public LocalDate getExpectedDisbursementDate() {
|
||||
return expectedDisbursementDate;
|
||||
}
|
||||
|
||||
@@ -31,9 +31,6 @@ public class SubmitLoanApplicationCommand {
|
||||
private Integer amortizationMethod;
|
||||
private Integer interestMethod;
|
||||
private Integer interestCalculationPeriodMethod;
|
||||
private boolean flexibleRepaymentSchedule = false;
|
||||
private boolean interestRebateAllowed = false;
|
||||
//
|
||||
|
||||
private String expectedDisbursementDateFormatted;
|
||||
private String repaymentsStartingFromDateFormatted;
|
||||
@@ -85,8 +82,6 @@ public class SubmitLoanApplicationCommand {
|
||||
this.repaymentFrequency = repaymentFrequency;
|
||||
this.numberOfRepayments = numberOfRepayments;
|
||||
this.amortizationMethod = amortizationMethod;
|
||||
this.flexibleRepaymentSchedule = false;
|
||||
this.interestRebateAllowed = false;
|
||||
}
|
||||
|
||||
public CalculateLoanScheduleCommand toCalculateLoanScheduleCommand() {
|
||||
@@ -256,22 +251,6 @@ public class SubmitLoanApplicationCommand {
|
||||
this.interestCalculationPeriodMethod = interestCalculationPeriodMethod;
|
||||
}
|
||||
|
||||
public boolean isFlexibleRepaymentSchedule() {
|
||||
return flexibleRepaymentSchedule;
|
||||
}
|
||||
|
||||
public void setFlexibleRepaymentSchedule(boolean flexibleRepaymentSchedule) {
|
||||
this.flexibleRepaymentSchedule = flexibleRepaymentSchedule;
|
||||
}
|
||||
|
||||
public boolean isInterestRebateAllowed() {
|
||||
return interestRebateAllowed;
|
||||
}
|
||||
|
||||
public void setInterestRebateAllowed(boolean interestRebateAllowed) {
|
||||
this.interestRebateAllowed = interestRebateAllowed;
|
||||
}
|
||||
|
||||
public LocalDate getInterestCalculatedFromDate() {
|
||||
return interestCalculatedFromDate;
|
||||
}
|
||||
|
||||
@@ -175,12 +175,10 @@ public class ImportPlatformServiceImpl implements ImportPlatformService {
|
||||
.fromInt(command.getRepaymentFrequency());
|
||||
final Integer defaultNumberOfInstallments = command.getNumberOfRepayments();
|
||||
final AmortizationMethod amortizationMethod = AmortizationMethod.fromInt(command.getAmortizationMethod());
|
||||
final boolean flexibleRepaymentSchedule = command.isFlexibleRepaymentSchedule();
|
||||
final boolean interestRebateAllowed = command.isInterestRebateAllowed();
|
||||
|
||||
LoanProductRelatedDetail loanRepaymentScheduleDetail = new LoanProductRelatedDetail(currency, command.getPrincipal(),
|
||||
defaultNominalInterestRatePerPeriod, interestPeriodFrequencyType, defaultAnnualNominalInterestRate, interestMethod, interestCalculationPeriodMethod,
|
||||
repayEvery, repaymentFrequencyType, defaultNumberOfInstallments, amortizationMethod, command.getInArrearsToleranceAmount(), flexibleRepaymentSchedule, interestRebateAllowed);
|
||||
repayEvery, repaymentFrequencyType, defaultNumberOfInstallments, amortizationMethod, command.getInArrearsToleranceAmount());
|
||||
|
||||
LoanSchedule loanSchedule = command.getLoanSchedule();
|
||||
List<ScheduledLoanInstallment> loanRepaymentSchedule = loanSchedule
|
||||
|
||||
@@ -53,9 +53,7 @@ public class LoanProduct extends AbstractAuditableCustom<AppUser, Long> {
|
||||
final BigDecimal defaultNominalInterestRatePerPeriod, final PeriodFrequencyType interestPeriodFrequencyType, final BigDecimal defaultAnnualNominalInterestRate,
|
||||
final InterestMethod interestMethod, final InterestCalculationPeriodMethod interestCalculationPeriodMethod,
|
||||
final Integer repayEvery, final PeriodFrequencyType repaymentFrequencyType, final Integer defaultNumberOfInstallments, final AmortizationMethod amortizationMethod,
|
||||
final BigDecimal inArrearsTolerance,
|
||||
final boolean flexibleRepaymentSchedule,
|
||||
final boolean interestRebateAllowed) {
|
||||
final BigDecimal inArrearsTolerance) {
|
||||
this.organisation = organisation;
|
||||
this.name = name.trim();
|
||||
if (StringUtils.isNotBlank(description)) {
|
||||
@@ -67,7 +65,7 @@ public class LoanProduct extends AbstractAuditableCustom<AppUser, Long> {
|
||||
this.loanProductRelatedDetail = new LoanProductRelatedDetail(currency,
|
||||
defaultPrincipal, defaultNominalInterestRatePerPeriod, interestPeriodFrequencyType, defaultAnnualNominalInterestRate,
|
||||
interestMethod, interestCalculationPeriodMethod,
|
||||
repayEvery, repaymentFrequencyType, defaultNumberOfInstallments, amortizationMethod, inArrearsTolerance, flexibleRepaymentSchedule, interestRebateAllowed);
|
||||
repayEvery, repaymentFrequencyType, defaultNumberOfInstallments, amortizationMethod, inArrearsTolerance);
|
||||
}
|
||||
|
||||
public Organisation getOrganisation() {
|
||||
|
||||
+3
-5
@@ -95,9 +95,7 @@ public class LoanProductRelatedDetail implements
|
||||
final PeriodFrequencyType repaymentFrequencyType,
|
||||
final Integer defaultNumberOfRepayments,
|
||||
final AmortizationMethod amortizationMethod,
|
||||
final BigDecimal inArrearsTolerance,
|
||||
final boolean flexibleRepaymentSchedule,
|
||||
final boolean interestRebateAllowed) {
|
||||
final BigDecimal inArrearsTolerance) {
|
||||
this.currency = currency;
|
||||
this.principal = defaultPrincipal;
|
||||
this.nominalInterestRatePerPeriod = defaultNominalInterestRatePerPeriod;
|
||||
@@ -110,8 +108,8 @@ public class LoanProductRelatedDetail implements
|
||||
this.numberOfRepayments = defaultNumberOfRepayments;
|
||||
this.amortizationMethod = amortizationMethod;
|
||||
this.inArrearsTolerance = inArrearsTolerance;
|
||||
this.flexibleRepaymentSchedule = flexibleRepaymentSchedule;
|
||||
this.interestRebateAllowed = interestRebateAllowed;
|
||||
this.flexibleRepaymentSchedule = false;
|
||||
this.interestRebateAllowed = false;
|
||||
}
|
||||
|
||||
public MonetaryCurrency getCurrency() {
|
||||
|
||||
+1
-3
@@ -59,8 +59,6 @@ public class CalculationPlatformServiceImpl implements
|
||||
final PeriodFrequencyType repaymentFrequencyType = PeriodFrequencyType.fromInt(command.getRepaymentFrequency());
|
||||
final Integer defaultNumberOfInstallments = command.getNumberOfRepayments();
|
||||
final AmortizationMethod amortizationMethod = AmortizationMethod.fromInt(command.getAmortizationMethod());
|
||||
final boolean flexibleRepaymentSchedule = command.isFlexibleRepaymentSchedule();
|
||||
final boolean interestRebateAllowed = command.isInterestRebateAllowed();
|
||||
|
||||
final BigDecimal defaultAnnualNominalInterestRate = this.aprCalculator.calculateFrom(interestPeriodFrequencyType, defaultNominalInterestRatePerPeriod);
|
||||
|
||||
@@ -73,7 +71,7 @@ public class CalculationPlatformServiceImpl implements
|
||||
defaultNominalInterestRatePerPeriod, interestPeriodFrequencyType, defaultAnnualNominalInterestRate,
|
||||
interestMethod, interestCalculationPeriodMethod,
|
||||
repayEvery, repaymentFrequencyType, defaultNumberOfInstallments, amortizationMethod,
|
||||
inArrearsTolerance, flexibleRepaymentSchedule, interestRebateAllowed);
|
||||
inArrearsTolerance);
|
||||
|
||||
LoanScheduleGenerator loanScheduleGenerator = this.loanScheduleFactory.create(interestMethod);
|
||||
|
||||
|
||||
+1
-4
@@ -121,14 +121,11 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
final PeriodFrequencyType repaymentFrequencyType = PeriodFrequencyType.fromInt(command.getRepaymentFrequency());
|
||||
final Integer defaultNumberOfInstallments = command.getNumberOfRepayments();
|
||||
final AmortizationMethod amortizationMethod = AmortizationMethod.fromInt(command.getAmortizationMethod());
|
||||
final boolean flexibleRepaymentSchedule = command.isFlexibleRepaymentSchedule();
|
||||
final boolean interestRebateAllowed = command.isInterestRebateAllowed();
|
||||
|
||||
LoanProductRelatedDetail loanRepaymentScheduleDetail = new LoanProductRelatedDetail(currency,
|
||||
command.getPrincipal(), defaultNominalInterestRatePerPeriod, interestPeriodFrequencyType, defaultAnnualNominalInterestRate,
|
||||
interestMethod, interestCalculationPeriodMethod,
|
||||
repayEvery, repaymentFrequencyType, defaultNumberOfInstallments, amortizationMethod, command.getInArrearsToleranceAmount(),
|
||||
flexibleRepaymentSchedule, interestRebateAllowed);
|
||||
repayEvery, repaymentFrequencyType, defaultNumberOfInstallments, amortizationMethod, command.getInArrearsToleranceAmount());
|
||||
|
||||
LoanSchedule loanSchedule = command.getLoanSchedule();
|
||||
List<ScheduledLoanInstallment> loanRepaymentSchedule = loanSchedule.getScheduledLoanInstallments();
|
||||
|
||||
+1
-2
@@ -76,8 +76,7 @@ public class LoanProductWritePlatformServiceJpaRepositoryImpl implements LoanPro
|
||||
LoanProduct loanproduct = new LoanProduct(currentUser.getOrganisation(), command.getName(), command.getDescription(),
|
||||
currency, command.getPrincipal(),
|
||||
command.getInterestRatePerPeriod(), interestFrequencyType, annualInterestRate, interestMethod, interestCalculationPeriodMethod,
|
||||
command.getRepaymentEvery(), repaymentFrequencyType, command.getNumberOfRepayments(), amortizationMethod, command.getInArrearsToleranceAmount(),
|
||||
command.isFlexibleRepaymentSchedule(), command.isInterestRebateAllowed());
|
||||
command.getRepaymentEvery(), repaymentFrequencyType, command.getNumberOfRepayments(), amortizationMethod, command.getInArrearsToleranceAmount());
|
||||
|
||||
this.loanProductRepository.save(loanproduct);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user