tidy up properties not used at present on commands.

This commit is contained in:
Keith Woodlock
2012-05-21 22:08:02 +01:00
parent de5b1209ae
commit 41b3847a8d
8 changed files with 9 additions and 62 deletions
@@ -23,8 +23,6 @@ public class CalculateLoanScheduleCommand {
private Integer amortizationMethod; private Integer amortizationMethod;
private Integer interestMethod; private Integer interestMethod;
private Integer interestCalculationPeriodMethod; private Integer interestCalculationPeriodMethod;
private boolean flexibleRepaymentSchedule = false;
private boolean interestRebateAllowed = false;
private LocalDate expectedDisbursementDate; private LocalDate expectedDisbursementDate;
private LocalDate repaymentsStartingFromDate; private LocalDate repaymentsStartingFromDate;
@@ -52,8 +50,6 @@ public class CalculateLoanScheduleCommand {
this.repaymentFrequency = repaymentFrequency; this.repaymentFrequency = repaymentFrequency;
this.numberOfRepayments = numberOfRepayments; this.numberOfRepayments = numberOfRepayments;
this.amortizationMethod = amortizationMethod; this.amortizationMethod = amortizationMethod;
this.flexibleRepaymentSchedule = false;
this.interestRebateAllowed = false;
this.expectedDisbursementDate = expectedDisbursementDate; this.expectedDisbursementDate = expectedDisbursementDate;
this.repaymentsStartingFromDate = repaymentsStartingFromDate; this.repaymentsStartingFromDate = repaymentsStartingFromDate;
@@ -157,22 +153,6 @@ public class CalculateLoanScheduleCommand {
this.interestCalculationPeriodMethod = interestCalculationPeriodMethod; 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() { public LocalDate getExpectedDisbursementDate() {
return expectedDisbursementDate; return expectedDisbursementDate;
} }
@@ -31,9 +31,6 @@ public class SubmitLoanApplicationCommand {
private Integer amortizationMethod; private Integer amortizationMethod;
private Integer interestMethod; private Integer interestMethod;
private Integer interestCalculationPeriodMethod; private Integer interestCalculationPeriodMethod;
private boolean flexibleRepaymentSchedule = false;
private boolean interestRebateAllowed = false;
//
private String expectedDisbursementDateFormatted; private String expectedDisbursementDateFormatted;
private String repaymentsStartingFromDateFormatted; private String repaymentsStartingFromDateFormatted;
@@ -85,8 +82,6 @@ public class SubmitLoanApplicationCommand {
this.repaymentFrequency = repaymentFrequency; this.repaymentFrequency = repaymentFrequency;
this.numberOfRepayments = numberOfRepayments; this.numberOfRepayments = numberOfRepayments;
this.amortizationMethod = amortizationMethod; this.amortizationMethod = amortizationMethod;
this.flexibleRepaymentSchedule = false;
this.interestRebateAllowed = false;
} }
public CalculateLoanScheduleCommand toCalculateLoanScheduleCommand() { public CalculateLoanScheduleCommand toCalculateLoanScheduleCommand() {
@@ -256,22 +251,6 @@ public class SubmitLoanApplicationCommand {
this.interestCalculationPeriodMethod = interestCalculationPeriodMethod; 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() { public LocalDate getInterestCalculatedFromDate() {
return interestCalculatedFromDate; return interestCalculatedFromDate;
} }
@@ -175,12 +175,10 @@ public class ImportPlatformServiceImpl implements ImportPlatformService {
.fromInt(command.getRepaymentFrequency()); .fromInt(command.getRepaymentFrequency());
final Integer defaultNumberOfInstallments = command.getNumberOfRepayments(); final Integer defaultNumberOfInstallments = command.getNumberOfRepayments();
final AmortizationMethod amortizationMethod = AmortizationMethod.fromInt(command.getAmortizationMethod()); final AmortizationMethod amortizationMethod = AmortizationMethod.fromInt(command.getAmortizationMethod());
final boolean flexibleRepaymentSchedule = command.isFlexibleRepaymentSchedule();
final boolean interestRebateAllowed = command.isInterestRebateAllowed();
LoanProductRelatedDetail loanRepaymentScheduleDetail = new LoanProductRelatedDetail(currency, command.getPrincipal(), LoanProductRelatedDetail loanRepaymentScheduleDetail = new LoanProductRelatedDetail(currency, command.getPrincipal(),
defaultNominalInterestRatePerPeriod, interestPeriodFrequencyType, defaultAnnualNominalInterestRate, interestMethod, interestCalculationPeriodMethod, defaultNominalInterestRatePerPeriod, interestPeriodFrequencyType, defaultAnnualNominalInterestRate, interestMethod, interestCalculationPeriodMethod,
repayEvery, repaymentFrequencyType, defaultNumberOfInstallments, amortizationMethod, command.getInArrearsToleranceAmount(), flexibleRepaymentSchedule, interestRebateAllowed); repayEvery, repaymentFrequencyType, defaultNumberOfInstallments, amortizationMethod, command.getInArrearsToleranceAmount());
LoanSchedule loanSchedule = command.getLoanSchedule(); LoanSchedule loanSchedule = command.getLoanSchedule();
List<ScheduledLoanInstallment> loanRepaymentSchedule = loanSchedule 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 BigDecimal defaultNominalInterestRatePerPeriod, final PeriodFrequencyType interestPeriodFrequencyType, final BigDecimal defaultAnnualNominalInterestRate,
final InterestMethod interestMethod, final InterestCalculationPeriodMethod interestCalculationPeriodMethod, final InterestMethod interestMethod, final InterestCalculationPeriodMethod interestCalculationPeriodMethod,
final Integer repayEvery, final PeriodFrequencyType repaymentFrequencyType, final Integer defaultNumberOfInstallments, final AmortizationMethod amortizationMethod, final Integer repayEvery, final PeriodFrequencyType repaymentFrequencyType, final Integer defaultNumberOfInstallments, final AmortizationMethod amortizationMethod,
final BigDecimal inArrearsTolerance, final BigDecimal inArrearsTolerance) {
final boolean flexibleRepaymentSchedule,
final boolean interestRebateAllowed) {
this.organisation = organisation; this.organisation = organisation;
this.name = name.trim(); this.name = name.trim();
if (StringUtils.isNotBlank(description)) { if (StringUtils.isNotBlank(description)) {
@@ -67,7 +65,7 @@ public class LoanProduct extends AbstractAuditableCustom<AppUser, Long> {
this.loanProductRelatedDetail = new LoanProductRelatedDetail(currency, this.loanProductRelatedDetail = new LoanProductRelatedDetail(currency,
defaultPrincipal, defaultNominalInterestRatePerPeriod, interestPeriodFrequencyType, defaultAnnualNominalInterestRate, defaultPrincipal, defaultNominalInterestRatePerPeriod, interestPeriodFrequencyType, defaultAnnualNominalInterestRate,
interestMethod, interestCalculationPeriodMethod, interestMethod, interestCalculationPeriodMethod,
repayEvery, repaymentFrequencyType, defaultNumberOfInstallments, amortizationMethod, inArrearsTolerance, flexibleRepaymentSchedule, interestRebateAllowed); repayEvery, repaymentFrequencyType, defaultNumberOfInstallments, amortizationMethod, inArrearsTolerance);
} }
public Organisation getOrganisation() { public Organisation getOrganisation() {
@@ -95,9 +95,7 @@ public class LoanProductRelatedDetail implements
final PeriodFrequencyType repaymentFrequencyType, final PeriodFrequencyType repaymentFrequencyType,
final Integer defaultNumberOfRepayments, final Integer defaultNumberOfRepayments,
final AmortizationMethod amortizationMethod, final AmortizationMethod amortizationMethod,
final BigDecimal inArrearsTolerance, final BigDecimal inArrearsTolerance) {
final boolean flexibleRepaymentSchedule,
final boolean interestRebateAllowed) {
this.currency = currency; this.currency = currency;
this.principal = defaultPrincipal; this.principal = defaultPrincipal;
this.nominalInterestRatePerPeriod = defaultNominalInterestRatePerPeriod; this.nominalInterestRatePerPeriod = defaultNominalInterestRatePerPeriod;
@@ -110,8 +108,8 @@ public class LoanProductRelatedDetail implements
this.numberOfRepayments = defaultNumberOfRepayments; this.numberOfRepayments = defaultNumberOfRepayments;
this.amortizationMethod = amortizationMethod; this.amortizationMethod = amortizationMethod;
this.inArrearsTolerance = inArrearsTolerance; this.inArrearsTolerance = inArrearsTolerance;
this.flexibleRepaymentSchedule = flexibleRepaymentSchedule; this.flexibleRepaymentSchedule = false;
this.interestRebateAllowed = interestRebateAllowed; this.interestRebateAllowed = false;
} }
public MonetaryCurrency getCurrency() { public MonetaryCurrency getCurrency() {
@@ -59,8 +59,6 @@ public class CalculationPlatformServiceImpl implements
final PeriodFrequencyType repaymentFrequencyType = PeriodFrequencyType.fromInt(command.getRepaymentFrequency()); final PeriodFrequencyType repaymentFrequencyType = PeriodFrequencyType.fromInt(command.getRepaymentFrequency());
final Integer defaultNumberOfInstallments = command.getNumberOfRepayments(); final Integer defaultNumberOfInstallments = command.getNumberOfRepayments();
final AmortizationMethod amortizationMethod = AmortizationMethod.fromInt(command.getAmortizationMethod()); 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); final BigDecimal defaultAnnualNominalInterestRate = this.aprCalculator.calculateFrom(interestPeriodFrequencyType, defaultNominalInterestRatePerPeriod);
@@ -73,7 +71,7 @@ public class CalculationPlatformServiceImpl implements
defaultNominalInterestRatePerPeriod, interestPeriodFrequencyType, defaultAnnualNominalInterestRate, defaultNominalInterestRatePerPeriod, interestPeriodFrequencyType, defaultAnnualNominalInterestRate,
interestMethod, interestCalculationPeriodMethod, interestMethod, interestCalculationPeriodMethod,
repayEvery, repaymentFrequencyType, defaultNumberOfInstallments, amortizationMethod, repayEvery, repaymentFrequencyType, defaultNumberOfInstallments, amortizationMethod,
inArrearsTolerance, flexibleRepaymentSchedule, interestRebateAllowed); inArrearsTolerance);
LoanScheduleGenerator loanScheduleGenerator = this.loanScheduleFactory.create(interestMethod); LoanScheduleGenerator loanScheduleGenerator = this.loanScheduleFactory.create(interestMethod);
@@ -121,14 +121,11 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
final PeriodFrequencyType repaymentFrequencyType = PeriodFrequencyType.fromInt(command.getRepaymentFrequency()); final PeriodFrequencyType repaymentFrequencyType = PeriodFrequencyType.fromInt(command.getRepaymentFrequency());
final Integer defaultNumberOfInstallments = command.getNumberOfRepayments(); final Integer defaultNumberOfInstallments = command.getNumberOfRepayments();
final AmortizationMethod amortizationMethod = AmortizationMethod.fromInt(command.getAmortizationMethod()); final AmortizationMethod amortizationMethod = AmortizationMethod.fromInt(command.getAmortizationMethod());
final boolean flexibleRepaymentSchedule = command.isFlexibleRepaymentSchedule();
final boolean interestRebateAllowed = command.isInterestRebateAllowed();
LoanProductRelatedDetail loanRepaymentScheduleDetail = new LoanProductRelatedDetail(currency, LoanProductRelatedDetail loanRepaymentScheduleDetail = new LoanProductRelatedDetail(currency,
command.getPrincipal(), defaultNominalInterestRatePerPeriod, interestPeriodFrequencyType, defaultAnnualNominalInterestRate, command.getPrincipal(), defaultNominalInterestRatePerPeriod, interestPeriodFrequencyType, defaultAnnualNominalInterestRate,
interestMethod, interestCalculationPeriodMethod, interestMethod, interestCalculationPeriodMethod,
repayEvery, repaymentFrequencyType, defaultNumberOfInstallments, amortizationMethod, command.getInArrearsToleranceAmount(), repayEvery, repaymentFrequencyType, defaultNumberOfInstallments, amortizationMethod, command.getInArrearsToleranceAmount());
flexibleRepaymentSchedule, interestRebateAllowed);
LoanSchedule loanSchedule = command.getLoanSchedule(); LoanSchedule loanSchedule = command.getLoanSchedule();
List<ScheduledLoanInstallment> loanRepaymentSchedule = loanSchedule.getScheduledLoanInstallments(); List<ScheduledLoanInstallment> loanRepaymentSchedule = loanSchedule.getScheduledLoanInstallments();
@@ -76,8 +76,7 @@ public class LoanProductWritePlatformServiceJpaRepositoryImpl implements LoanPro
LoanProduct loanproduct = new LoanProduct(currentUser.getOrganisation(), command.getName(), command.getDescription(), LoanProduct loanproduct = new LoanProduct(currentUser.getOrganisation(), command.getName(), command.getDescription(),
currency, command.getPrincipal(), currency, command.getPrincipal(),
command.getInterestRatePerPeriod(), interestFrequencyType, annualInterestRate, interestMethod, interestCalculationPeriodMethod, command.getInterestRatePerPeriod(), interestFrequencyType, annualInterestRate, interestMethod, interestCalculationPeriodMethod,
command.getRepaymentEvery(), repaymentFrequencyType, command.getNumberOfRepayments(), amortizationMethod, command.getInArrearsToleranceAmount(), command.getRepaymentEvery(), repaymentFrequencyType, command.getNumberOfRepayments(), amortizationMethod, command.getInArrearsToleranceAmount());
command.isFlexibleRepaymentSchedule(), command.isInterestRebateAllowed());
this.loanProductRepository.save(loanproduct); this.loanProductRepository.save(loanproduct);