diff --git a/mifosng-db/patches/patch-15_add_deposit_every_for_m_product_savings.sql b/mifosng-db/patches/patch-15a-add_deposit_every_for_m_product_savings.sql similarity index 100% rename from mifosng-db/patches/patch-15_add_deposit_every_for_m_product_savings.sql rename to mifosng-db/patches/patch-15a-add_deposit_every_for_m_product_savings.sql diff --git a/mifosng-db/patches/patch-10_add_deposit_freq_col_for_m_saving_account.sql b/mifosng-db/patches/patch-15b-add_deposit_freq_col_for_m_saving_account.sql similarity index 100% rename from mifosng-db/patches/patch-10_add_deposit_freq_col_for_m_saving_account.sql rename to mifosng-db/patches/patch-15b-add_deposit_freq_col_for_m_saving_account.sql diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/data/SavingAccountData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/data/SavingAccountData.java index 0506c2b68..660aac33c 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/data/SavingAccountData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/data/SavingAccountData.java @@ -24,9 +24,11 @@ public class SavingAccountData { private final String productName; private final EnumOptionData productType; private final CurrencyData currencyData; + // FIXME - Madhukar - spelling mistake on word 'deposit' - directly affects api and how people use it. private final BigDecimal savingsDepostiAmountPerPeriod; private final EnumOptionData savingsFrequencyType; private final BigDecimal totalDepositAmount; + // FIXME - Madhukar - spelling mistake on work 'recurring' - directly affects api and how people use it. private final BigDecimal reccuringInterestRate; private final BigDecimal savingInterestRate; private final EnumOptionData interestType; @@ -49,15 +51,27 @@ public class SavingAccountData { private final Integer lockinPeriod; private final EnumOptionData lockinPeriodType; private final Integer depositEvery; - + + @SuppressWarnings("unused") private final List productOptions; + @SuppressWarnings("unused") private final List currencyOptions; + @SuppressWarnings("unused") private final List savingsProductTypeOptions; + @SuppressWarnings("unused") private final List tenureTypeOptions; + @SuppressWarnings("unused") private final List savingFrequencyOptions; + @SuppressWarnings("unused") private final List savingsInterestTypeOptions; + @SuppressWarnings("unused") private final List lockinPeriodTypeOptions; + @SuppressWarnings("unused") private final List interestCalculationOptions; + + public static SavingAccountData createFrom(final Long clientId, final String clientDisplayName) { + return new SavingAccountData(clientId, clientDisplayName); + } public SavingAccountData(Long id, EnumOptionData status, String externalId, Long clientId, String clientName, Long productId, String productName, EnumOptionData productType, CurrencyData currencyData, BigDecimal savingsDepostiAmountPerPeriod, @@ -67,7 +81,7 @@ public class SavingAccountData { BigDecimal projectedInterestAccuredOnMaturity, BigDecimal actualInterestAccured, BigDecimal projectedMaturityAmount, BigDecimal actualMaturityAmount, boolean preClosureAllowed, BigDecimal preClosureInterestRate, LocalDate withdrawnonDate, LocalDate rejectedonDate, LocalDate closedonDate, boolean isLockinPeriodAllowed, Integer lockinPeriod, - EnumOptionData lockinPeriodType,Integer depositEvery) { + EnumOptionData lockinPeriodType, Integer depositEvery) { this.id = id; this.status = status; this.externalId = externalId; @@ -110,11 +124,11 @@ public class SavingAccountData { this.savingsInterestTypeOptions = null; this.lockinPeriodTypeOptions = null; this.interestCalculationOptions = null; - + } - public SavingAccountData(Long clientId, String clientName) { - this.id = null; + public SavingAccountData(Long clientId, String clientName) { + this.id = null; this.status = null; this.externalId = null; this.clientId = clientId; @@ -122,7 +136,8 @@ public class SavingAccountData { this.productId = null; this.productName = null; this.productType = null; - this.currencyData = new CurrencyData("USD", "US Dollar", 2, "$", "currency.USD");; + this.currencyData = new CurrencyData("USD", "US Dollar", 2, "$", "currency.USD"); + ; this.savingsDepostiAmountPerPeriod = null; this.savingsFrequencyType = null; this.totalDepositAmount = null; @@ -146,8 +161,8 @@ public class SavingAccountData { this.closedonDate = null; this.isLockinPeriodAllowed = false; this.lockinPeriod = null; - this.lockinPeriodType = null; - this.depositEvery=null; + this.lockinPeriodType = null; + this.depositEvery = null; this.productOptions = new ArrayList(); this.currencyOptions = null; this.savingsProductTypeOptions = null; @@ -156,46 +171,47 @@ public class SavingAccountData { this.savingsInterestTypeOptions = null; this.lockinPeriodTypeOptions = null; this.interestCalculationOptions = null; - } + } + + public SavingAccountData(SavingAccountData account, Collection productOptions, List currencyOptions, + List savingsProductTypeOptions, List tenureTypeOptions, + List savingFrequencyOptions, List savingsInterestTypeOptions, + List lockinPeriodTypeOptions, List interestCalculationOptions) { + this.id = account.id; + this.status = account.status; + this.externalId = account.externalId; + this.clientId = account.clientId; + this.clientName = account.clientName; + this.productId = account.productId; + this.productName = account.productName; + this.productType = account.productType; + this.currencyData = account.currencyData; + this.savingsDepostiAmountPerPeriod = account.savingsDepostiAmountPerPeriod; + this.savingsFrequencyType = account.savingsFrequencyType; + this.totalDepositAmount = account.totalDepositAmount; + this.reccuringInterestRate = account.reccuringInterestRate; + this.savingInterestRate = account.savingInterestRate; + this.interestType = account.interestType; + this.interestCalculationMethod = account.interestCalculationMethod; + this.tenure = account.tenure; + this.tenureType = account.tenureType; + this.projectedCommencementDate = account.projectedCommencementDate; + this.actualCommencementDate = account.actualCommencementDate; + this.maturesOnDate = account.maturesOnDate; + this.projectedInterestAccuredOnMaturity = account.projectedInterestAccuredOnMaturity; + this.actualInterestAccured = account.actualInterestAccured; + this.projectedMaturityAmount = account.projectedMaturityAmount; + this.actualMaturityAmount = account.actualMaturityAmount; + this.preClosureAllowed = account.preClosureAllowed; + this.preClosureInterestRate = account.preClosureInterestRate; + this.withdrawnonDate = account.withdrawnonDate; + this.rejectedonDate = account.rejectedonDate; + this.closedonDate = account.closedonDate; + this.isLockinPeriodAllowed = account.isLockinPeriodAllowed; + this.lockinPeriod = account.lockinPeriod; + this.lockinPeriodType = account.lockinPeriodType; + this.depositEvery = account.depositEvery; - public SavingAccountData(SavingAccountData account, Collection productOptions, List currencyOptions, - List savingsProductTypeOptions, List tenureTypeOptions, List savingFrequencyOptions, - List savingsInterestTypeOptions, List lockinPeriodTypeOptions, List interestCalculationOptions) { - this.id = account.getId(); - this.status = account.getStatus(); - this.externalId = account.getExternalId(); - this.clientId = account.getClientId(); - this.clientName = account.getClientName(); - this.productId = account.getProductId(); - this.productName = account.getProductName(); - this.productType = account.getProductType(); - this.currencyData = account.getCurrencyData(); - this.savingsDepostiAmountPerPeriod = account.getSavingsDepostiAmountPerPeriod(); - this.savingsFrequencyType = account.getSavingsFrequencyType(); - this.totalDepositAmount = account.getTotalDepositAmount(); - this.reccuringInterestRate = account.getReccuringInterestRate(); - this.savingInterestRate = account.getSavingInterestRate(); - this.interestType = account.getInterestType(); - this.interestCalculationMethod = account.getInterestCalculationMethod(); - this.tenure = account.getTenure(); - this.tenureType = account.getTenureType(); - this.projectedCommencementDate = account.getProjectedCommencementDate(); - this.actualCommencementDate = account.getActualCommencementDate(); - this.maturesOnDate = account.getMaturesOnDate(); - this.projectedInterestAccuredOnMaturity = account.getProjectedInterestAccuredOnMaturity(); - this.actualInterestAccured = account.getActualInterestAccured(); - this.projectedMaturityAmount = account.getProjectedMaturityAmount(); - this.actualMaturityAmount = account.getActualMaturityAmount(); - this.preClosureAllowed = account.isPreClosureAllowed(); - this.preClosureInterestRate = account.getPreClosureInterestRate(); - this.withdrawnonDate = account.getWithdrawnonDate(); - this.rejectedonDate = account.getRejectedonDate(); - this.closedonDate = account.getClosedonDate(); - this.isLockinPeriodAllowed = account.isLockinPeriodAllowed(); - this.lockinPeriod = account.getLockinPeriod(); - this.lockinPeriodType = account.getLockinPeriodType(); - this.depositEvery = account.getDepositEvery(); - this.productOptions = (List) productOptions; this.currencyOptions = currencyOptions; this.savingsProductTypeOptions = savingsProductTypeOptions; @@ -204,14 +220,16 @@ public class SavingAccountData { this.savingsInterestTypeOptions = savingsInterestTypeOptions; this.lockinPeriodTypeOptions = lockinPeriodTypeOptions; this.interestCalculationOptions = interestCalculationOptions; - } + } - public SavingAccountData( Long clientId, String clientName, Long productId, String productName, CurrencyData currency, BigDecimal interestRate, - BigDecimal savingsDepostiAmountPerPeriod, EnumOptionData productType, EnumOptionData tenureType, Integer tenure, EnumOptionData savingsFrequencyType, - EnumOptionData interestType, EnumOptionData interestCalculationMethod, BigDecimal minimumBalanceForWithdrawal, boolean partialDepositAllowed, - boolean lockinPeriodAllowed, Integer lockinPeriod, EnumOptionData lockinPeriodType, Integer depositEvery) { - - this.id = null; + // FIXME - Madhukar - unused variables been passed into construction - why? + public SavingAccountData(Long clientId, String clientName, Long productId, String productName, CurrencyData currency, + BigDecimal interestRate, BigDecimal savingsDepostiAmountPerPeriod, EnumOptionData productType, EnumOptionData tenureType, + Integer tenure, EnumOptionData savingsFrequencyType, EnumOptionData interestType, EnumOptionData interestCalculationMethod, + BigDecimal minimumBalanceForWithdrawal, boolean partialDepositAllowed, boolean lockinPeriodAllowed, Integer lockinPeriod, + EnumOptionData lockinPeriodType, Integer depositEvery) { + + this.id = null; this.status = null; this.externalId = null; this.clientId = clientId; @@ -244,7 +262,7 @@ public class SavingAccountData { this.isLockinPeriodAllowed = false; this.lockinPeriod = lockinPeriod; this.lockinPeriodType = lockinPeriodType; - this.depositEvery=depositEvery; + this.depositEvery = depositEvery; this.productOptions = null; this.currencyOptions = null; this.savingsProductTypeOptions = null; @@ -253,179 +271,6 @@ public class SavingAccountData { this.savingsInterestTypeOptions = null; this.lockinPeriodTypeOptions = null; this.interestCalculationOptions = null; - - } - public static SavingAccountData createFrom(final Long clientId, final String clientDisplayName) { - return new SavingAccountData(clientId,clientDisplayName); - } - - public Long getId() { - return this.id; - } - - public EnumOptionData getStatus() { - return this.status; - } - - public String getExternalId() { - return this.externalId; - } - - public Long getClientId() { - return this.clientId; - } - - public String getClientName() { - return this.clientName; - } - - public Long getProductId() { - return this.productId; - } - - public String getProductName() { - return this.productName; - } - - public EnumOptionData getProductType() { - return this.productType; - } - - public CurrencyData getCurrencyData() { - return this.currencyData; - } - - public BigDecimal getSavingsDepostiAmountPerPeriod() { - return this.savingsDepostiAmountPerPeriod; - } - - public EnumOptionData getSavingsFrequencyType() { - return this.savingsFrequencyType; - } - - public BigDecimal getTotalDepositAmount() { - return this.totalDepositAmount; - } - - public BigDecimal getReccuringInterestRate() { - return this.reccuringInterestRate; - } - - public BigDecimal getSavingInterestRate() { - return this.savingInterestRate; - } - - public EnumOptionData getInterestType() { - return this.interestType; - } - - public EnumOptionData getInterestCalculationMethod() { - return this.interestCalculationMethod; - } - - public Integer getTenure() { - return this.tenure; - } - - public EnumOptionData getTenureType() { - return this.tenureType; - } - - public LocalDate getProjectedCommencementDate() { - return this.projectedCommencementDate; - } - - public LocalDate getActualCommencementDate() { - return this.actualCommencementDate; - } - - public LocalDate getMaturesOnDate() { - return this.maturesOnDate; - } - - public BigDecimal getProjectedInterestAccuredOnMaturity() { - return this.projectedInterestAccuredOnMaturity; - } - - public BigDecimal getActualInterestAccured() { - return this.actualInterestAccured; - } - - public BigDecimal getProjectedMaturityAmount() { - return this.projectedMaturityAmount; - } - - public BigDecimal getActualMaturityAmount() { - return this.actualMaturityAmount; - } - - public boolean isPreClosureAllowed() { - return this.preClosureAllowed; - } - - public BigDecimal getPreClosureInterestRate() { - return this.preClosureInterestRate; - } - - public LocalDate getWithdrawnonDate() { - return this.withdrawnonDate; - } - - public LocalDate getRejectedonDate() { - return this.rejectedonDate; - } - - public LocalDate getClosedonDate() { - return this.closedonDate; - } - - public boolean isLockinPeriodAllowed() { - return this.isLockinPeriodAllowed; - } - - public Integer getLockinPeriod() { - return this.lockinPeriod; - } - - public EnumOptionData getLockinPeriodType() { - return this.lockinPeriodType; - } - - public Integer getDepositEvery() { - return this.depositEvery; - } - - public List getProductOptions() { - return this.productOptions; - } - - public List getCurrencyOptions() { - return this.currencyOptions; - } - - public List getSavingsProductTypeOptions() { - return this.savingsProductTypeOptions; - } - - public List getTenureTypeOptions() { - return this.tenureTypeOptions; - } - - public List getSavingFrequencyOptions() { - return this.savingFrequencyOptions; - } - - public List getSavingsInterestTypeOptions() { - return this.savingsInterestTypeOptions; - } - - public List getLockinPeriodTypeOptions() { - return this.lockinPeriodTypeOptions; - } - - public List getInterestCalculationOptions() { - return this.interestCalculationOptions; - } - + } } \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/domain/SavingAccount.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/domain/SavingAccount.java index 60c1cbe74..73e394f23 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/domain/SavingAccount.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/domain/SavingAccount.java @@ -76,6 +76,7 @@ public class SavingAccount extends AbstractAuditableCustom { @Column(name = "tenure", nullable = false) private Integer tenure; + // FIXME - MADHUKAR - Do not use the actual enum type here use integer representation @Column(name = "tenure_type", nullable = false) private TenureTypeEnum tenureType; diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/domain/SavingProductType.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/domain/SavingProductType.java index 58d2681fb..22832f16a 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/domain/SavingProductType.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/domain/SavingProductType.java @@ -2,7 +2,9 @@ package org.mifosplatform.portfolio.savingsaccountproduct.domain; public enum SavingProductType { - INVALID(0, "savingProductType.invalid"), RECCURING(1, "savingProductType.reccuring"), REGULAR(2, "savingProductType.regular"); + INVALID(0, "savingProductType.invalid"), // + RECCURING(1, "savingProductType.reccuring"), // + REGULAR(2, "savingProductType.regular"); private final Integer value; private final String code; diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/service/SavingProductEnumerations.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/service/SavingProductEnumerations.java index 4b622d2d9..3daa0bb71 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/service/SavingProductEnumerations.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/service/SavingProductEnumerations.java @@ -166,6 +166,7 @@ public class SavingProductEnumerations { final String codePrefix = "savings.product."; EnumOptionData optionData = null; switch (type) { + // FIXME - Madhukar - spelling mistake on 'Recurring' case RECCURING: optionData = new EnumOptionData(SavingProductType.RECCURING.getValue().longValue(), codePrefix + SavingProductType.RECCURING.getCode(), "Reccuring"); @@ -185,5 +186,4 @@ public class SavingProductEnumerations { } return optionData; } - -} +} \ No newline at end of file