From 41b3847a8d3e52b1562cf21641a8d6b06b973561 Mon Sep 17 00:00:00 2001 From: Keith Woodlock Date: Mon, 21 May 2012 22:08:02 +0100 Subject: [PATCH] tidy up properties not used at present on commands. --- .../command/CalculateLoanScheduleCommand.java | 20 ------------------ .../command/SubmitLoanApplicationCommand.java | 21 ------------------- .../platform/ImportPlatformServiceImpl.java | 4 +--- .../platform/loan/domain/LoanProduct.java | 6 ++---- .../loan/domain/LoanProductRelatedDetail.java | 8 +++---- .../CalculationPlatformServiceImpl.java | 4 +--- ...WritePlatformServiceJpaRepositoryImpl.java | 5 +---- ...WritePlatformServiceJpaRepositoryImpl.java | 3 +-- 8 files changed, 9 insertions(+), 62 deletions(-) diff --git a/mifosng-data/src/main/java/org/mifosng/data/command/CalculateLoanScheduleCommand.java b/mifosng-data/src/main/java/org/mifosng/data/command/CalculateLoanScheduleCommand.java index 08db1e59f..6d22c7a67 100644 --- a/mifosng-data/src/main/java/org/mifosng/data/command/CalculateLoanScheduleCommand.java +++ b/mifosng-data/src/main/java/org/mifosng/data/command/CalculateLoanScheduleCommand.java @@ -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; } diff --git a/mifosng-data/src/main/java/org/mifosng/data/command/SubmitLoanApplicationCommand.java b/mifosng-data/src/main/java/org/mifosng/data/command/SubmitLoanApplicationCommand.java index d076dd7df..42ac4ae2e 100644 --- a/mifosng-data/src/main/java/org/mifosng/data/command/SubmitLoanApplicationCommand.java +++ b/mifosng-data/src/main/java/org/mifosng/data/command/SubmitLoanApplicationCommand.java @@ -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; } diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/ImportPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosng/platform/ImportPlatformServiceImpl.java index ce2427b69..9acb17891 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/ImportPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/ImportPlatformServiceImpl.java @@ -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 loanRepaymentSchedule = loanSchedule diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanProduct.java b/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanProduct.java index 3c57d8482..1e2d731c4 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanProduct.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanProduct.java @@ -53,9 +53,7 @@ public class LoanProduct extends AbstractAuditableCustom { 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 { 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() { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanProductRelatedDetail.java b/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanProductRelatedDetail.java index e973776b7..f92e8d599 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanProductRelatedDetail.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/LoanProductRelatedDetail.java @@ -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() { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/CalculationPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/CalculationPlatformServiceImpl.java index 527b1351e..d24d60bd7 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/CalculationPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/CalculationPlatformServiceImpl.java @@ -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); diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanWritePlatformServiceJpaRepositoryImpl.java b/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanWritePlatformServiceJpaRepositoryImpl.java index f7f99a096..461e62b5e 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanWritePlatformServiceJpaRepositoryImpl.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/loan/service/LoanWritePlatformServiceJpaRepositoryImpl.java @@ -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 loanRepaymentSchedule = loanSchedule.getScheduledLoanInstallments(); diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java b/mifosng-provider/src/main/java/org/mifosng/platform/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java index fc7bfebc9..e838dfead 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java @@ -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);