diff --git a/api-docs/apiLive.htm b/api-docs/apiLive.htm
index 9d1ba046c..7d812255b 100644
--- a/api-docs/apiLive.htm
+++ b/api-docs/apiLive.htm
@@ -6985,35 +6985,49 @@ Content-Type: application/json
Field Descriptions |
+ | name |
+ | Used as product name |
+
+ | description |
+ | Used to describe about the product. |
+
| digitsAfterDecimal |
| Override the currency default value for digitsAfterDecimal. |
- | minimumBalance : |
+ | minDeposit : |
| Minimum deposit amount that is required to create a deposit account. |
- | maximumBalance : |
+ | defaultDeposit : |
+ | Default deposit amount that is required to create a deposit account. |
+
+ | maxDeposit : |
| The max deposit amount that can be limited to create a deposit account. |
|
-
- | interestCompoundedEvery |
- Interest amount which is accrued or earned during the tenure of the deposit account will be posted to customer as interest as per the selected period in "interestCompoundedEvery" and combination of "interestCompoundedEveryPeriodType"
- e.g.Every 1-Month |
| tenureInMonths |
The duration for fixed deposit (in months).
e.g. 12
|
- | maturityDefaultInterestRate |
+
+ | defaultInterestRate |
Default interest rate for Fixed Deposit product
e.g. 12 |
- | maturityMinInterestRate |
+ | minInterestRate |
Minimum supported interest rate for Fixed Deposit product
e.g. 8 |
- | maturityMaxInterestRate |
+ | maxInterestRate |
Maximum supported interest rate for Fixed Deposit product
e.g. 14 |
+ | interestCompoundedEvery |
+ Interest amount which is accrued or earned during the tenure of the deposit account will be posted to customer as interest as per the selected period in "interestCompoundedEvery" and combination of "interestCompoundedEveryPeriodType"
+ e.g.Every 1-Month |
+
+ | interestCompoundedEveryPeriodType |
+ Denotes the interest compounding period type, used with combination of interestCompoundedEvery
+ e.g. Months, Weeks etc |
+
| renewalAllowed |
Allows to renew the deposit account on maturity
Used like: renewalAllowed:true |
diff --git a/mifosng-db/patches/18-modify_m_product_deposit.sql b/mifosng-db/patches/18-modify_m_product_deposit.sql
new file mode 100644
index 000000000..facf86bfb
--- /dev/null
+++ b/mifosng-db/patches/18-modify_m_product_deposit.sql
@@ -0,0 +1,9 @@
+ALTER TABLE m_product_deposit
+ CHANGE `minimum_balance` `min_balance` decimal(19,6) NOT NULL,
+ CHANGE `maximum_balance` `max_balance` decimal(19,6) NOT NULL,
+ CHANGE `maturity_default_interest_rate` `default_interest_rate` decimal(19,6) NOT NULL,
+ CHANGE `maturity_min_interest_rate` `min_interest_rate` decimal(19,6) NOT NULL,
+ CHANGE `maturity_max_interest_rate` `max_interest_rate` decimal(19,6) NOT NULL,
+ CHANGE `min_balance` `min_deposit` decimal(19,6) NOT NULL,
+ CHANGE `max_balance` `max_deposit` decimal(19,6) NOT NULL,
+ ADD COLUMN `default_deposit` decimal(19,6) NOT NULL AFTER `min_deposit`;
\ No newline at end of file
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositaccount/service/DepositAccountAssembler.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositaccount/service/DepositAccountAssembler.java
index ffec9fae5..e274aa4e3 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositaccount/service/DepositAccountAssembler.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositaccount/service/DepositAccountAssembler.java
@@ -97,7 +97,7 @@ public class DepositAccountAssembler {
tenureInMonths = tenureInMonthsCommandValue;
}
- BigDecimal maturityInterestRate = product.getMaturityDefaultInterestRate();
+ BigDecimal maturityInterestRate = product.getDefaultInterestRate();
if (maturityInterestRateCommandValue != null) {
maturityInterestRate = maturityInterestRateCommandValue;
}
@@ -107,8 +107,8 @@ public class DepositAccountAssembler {
preClosureInterestRate = preClosureInterestRateCommandValue;
}
- if (product.getMaturityMinInterestRate().compareTo(preClosureInterestRate) == -1) { throw new DepositAccounDataValidationtException(
- preClosureInterestRate, product.getMaturityMinInterestRate()); }
+ if (product.getMinInterestRate().compareTo(preClosureInterestRate) == -1) { throw new DepositAccounDataValidationtException(
+ preClosureInterestRate, product.getMinInterestRate()); }
Integer compoundingInterestEvery = product.getInterestCompoundedEvery();
if (interestCompoundedEveryCommandValue != null) {
@@ -219,8 +219,8 @@ public class DepositAccountAssembler {
preClosureInterestRate = newValue;
}
- if (product.getMaturityMinInterestRate().compareTo(preClosureInterestRate) == -1) { throw new DepositAccounDataValidationtException(
- preClosureInterestRate, product.getMaturityMinInterestRate()); }
+ if (product.getMinInterestRate().compareTo(preClosureInterestRate) == -1) { throw new DepositAccounDataValidationtException(
+ preClosureInterestRate, product.getMinInterestRate()); }
Integer interestCompoundedEvery = account.getInterestCompoundedEvery();
final String interestCompoundedEveryParamName = "interestCompoundedEvery";
@@ -384,8 +384,8 @@ public class DepositAccountAssembler {
preClosureInterestRate = newValue;
}
- if (product.getMaturityMinInterestRate().compareTo(preClosureInterestRate) == -1) { throw new DepositAccounDataValidationtException(
- preClosureInterestRate, product.getMaturityMinInterestRate()); }
+ if (product.getMinInterestRate().compareTo(preClosureInterestRate) == -1) { throw new DepositAccounDataValidationtException(
+ preClosureInterestRate, product.getMinInterestRate()); }
Integer interestCompoundedEvery = account.getInterestCompoundedEvery();
final String interestCompoundedEveryParamName = "interestCompoundedEvery";
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/api/DepositProductsApiResource.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/api/DepositProductsApiResource.java
index add539db9..ad13c33a7 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/api/DepositProductsApiResource.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/api/DepositProductsApiResource.java
@@ -48,8 +48,8 @@ import org.springframework.stereotype.Component;
public class DepositProductsApiResource {
private final Set DEPOSIT_PRODUCT_DATA_PARAMETERS = new HashSet(Arrays.asList("id", "externalId", "name",
- "description", "currencyCode", "digitsAfterDecimal", "minimumBalance", "maximumBalance", "tenureInMonths",
- "maturityDefaultInterestRate", "maturityMinInterestRate", "maturityMaxInterestRate", "interestCompoundedEvery",
+ "description", "currencyCode", "digitsAfterDecimal", "minDeposit", "defaultDeposit", "maxDeposit", "tenureInMonths",
+ "defaultInterestRate", "minInterestRate", "maxInterestRate", "interestCompoundedEvery",
"interestCompoundedEveryPeriodType", "renewalAllowed", "preClosureAllowed", "preClosureInterestRate",
"interestCompoundingAllowed", "isLockinPeriodAllowed", "lockinPeriod", "lockinPeriodType", "currency", "currencyOptions",
"interestCompoundedEveryPeriodTypeOptions"));
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/data/DepositProductData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/data/DepositProductData.java
index 0f322c2b6..e2408c170 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/data/DepositProductData.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/data/DepositProductData.java
@@ -24,12 +24,13 @@ public class DepositProductData {
private final String description;
private final String currencyCode;
private final Integer digitsAfterDecimal;
- private final BigDecimal minimumBalance;
- private final BigDecimal maximumBalance;
+ private final BigDecimal minDeposit;
+ private final BigDecimal defaultDeposit;
+ private final BigDecimal maxDeposit;
private final Integer tenureInMonths;
- private final BigDecimal maturityDefaultInterestRate;
- private final BigDecimal maturityMinInterestRate;
- private final BigDecimal maturityMaxInterestRate;
+ private final BigDecimal defaultInterestRate;
+ private final BigDecimal minInterestRate;
+ private final BigDecimal maxInterestRate;
private final Integer interestCompoundedEvery;
private final EnumOptionData interestCompoundedEveryPeriodType;
private final CurrencyData currency;
@@ -48,9 +49,9 @@ public class DepositProductData {
public DepositProductData(final Long id, final String externalId,
final String name, final String description, final String currencyCode, final Integer digitsAfterDecimal,
- final BigDecimal minimumBalance, final BigDecimal maximumBalance, final Integer tenureMonths,
- final BigDecimal maturityDefaultInterestRate, final BigDecimal maturityMinInterestRate,
- final BigDecimal maturityMaxInterestRate, final Integer interestCompoundedEvery,
+ final BigDecimal minDeposit, final BigDecimal defaultDeposit, final BigDecimal maxDeposit, final Integer tenureMonths,
+ final BigDecimal defaultInterestRate, final BigDecimal minInterestRate,
+ final BigDecimal maxInterestRate, final Integer interestCompoundedEvery,
final EnumOptionData interestCompoundedEveryPeriodType, final boolean renewalAllowed, final boolean preClosureAllowed,
final BigDecimal preClosureInterestRate, final boolean interestCompoundingAllowed, final boolean isLockinPeriodAllowed,
final Integer lockinPeriod, final EnumOptionData lockinPeriodType,final CurrencyData currencyData) {
@@ -61,13 +62,14 @@ public class DepositProductData {
this.description = description;
this.currencyCode = currencyCode;
this.digitsAfterDecimal = digitsAfterDecimal;
- this.minimumBalance = minimumBalance;
- this.maximumBalance = maximumBalance;
+ this.minDeposit = minDeposit;
+ this.defaultDeposit = defaultDeposit;
+ this.maxDeposit = maxDeposit;
this.tenureInMonths = tenureMonths;
- this.maturityDefaultInterestRate = maturityDefaultInterestRate;
- this.maturityMinInterestRate = maturityMinInterestRate;
- this.maturityMaxInterestRate = maturityMaxInterestRate;
+ this.defaultInterestRate = defaultInterestRate;
+ this.minInterestRate = minInterestRate;
+ this.maxInterestRate = maxInterestRate;
this.interestCompoundedEvery = interestCompoundedEvery;
this.interestCompoundedEveryPeriodType = interestCompoundedEveryPeriodType;
this.renewalAllowed = renewalAllowed;
@@ -92,13 +94,14 @@ public class DepositProductData {
this.description = null;
this.currencyCode = null;
this.digitsAfterDecimal = null;
- this.minimumBalance = null;
- this.maximumBalance = null;
+ this.minDeposit = null;
+ this.defaultDeposit = null;
+ this.maxDeposit = null;
this.tenureInMonths = null;
- this.maturityDefaultInterestRate = null;
- this.maturityMinInterestRate = null;
- this.maturityMaxInterestRate = null;
+ this.defaultInterestRate = null;
+ this.minInterestRate = null;
+ this.maxInterestRate = null;
this.interestCompoundedEvery = null;
this.interestCompoundedEveryPeriodType = defaultInterestCompoundedEveryPeriodType;
@@ -119,30 +122,31 @@ public class DepositProductData {
public DepositProductData(final DepositProductData product, final Collection currencyOptions,
final List interestCompoundedEveryPeriodTypeOptions) {
- this.id = product.getId();
- this.externalId = product.getExternalId();
- this.name = product.getName();
- this.description = product.getDescription();
- this.currencyCode = product.getCurrencyCode();
- this.digitsAfterDecimal = product.getDigitsAfterDecimal();
- this.minimumBalance = product.getMinimumBalance();
- this.maximumBalance = product.getMaximumBalance();
+ this.id = product.id;
+ this.externalId = product.externalId;
+ this.name = product.name;
+ this.description = product.description;
+ this.currencyCode = product.currencyCode;
+ this.digitsAfterDecimal = product.digitsAfterDecimal;
+ this.minDeposit = product.minDeposit;
+ this.defaultDeposit = product.defaultDeposit;
+ this.maxDeposit = product.maxDeposit;
- this.tenureInMonths = product.getTenureInMonths();
- this.maturityDefaultInterestRate = product.getMaturityDefaultInterestRate();
- this.maturityMinInterestRate = product.getMaturityMinInterestRate();
- this.maturityMaxInterestRate = product.getMaturityMaxInterestRate();
- this.interestCompoundedEvery = product.getInterestCompoundedEvery();
- this.interestCompoundedEveryPeriodType = product.getInterestCompoundedEveryPeriodType();
+ this.tenureInMonths = product.tenureInMonths;
+ this.defaultInterestRate = product.defaultInterestRate;
+ this.minInterestRate = product.minInterestRate;
+ this.maxInterestRate = product.maxInterestRate;
+ this.interestCompoundedEvery = product.interestCompoundedEvery;
+ this.interestCompoundedEveryPeriodType = product.interestCompoundedEveryPeriodType;
- this.renewalAllowed = product.isRenewalAllowed();
- this.preClosureAllowed = product.isPreClosureAllowed();
- this.preClosureInterestRate = product.getPreClosureInterestRate();
- this.interestCompoundingAllowed = product.isInterestCompoundingAllowed();
+ this.renewalAllowed = product.renewalAllowed;
+ this.preClosureAllowed = product.preClosureAllowed;
+ this.preClosureInterestRate = product.preClosureInterestRate;
+ this.interestCompoundingAllowed = product.interestCompoundingAllowed;
- this.lockinPeriod = product.getLockinPeriod();
- this.lockinPeriodType = product.getLockinPeriodType();
- this.isLockinPeriodAllowed = product.isLockinPeriodAllowed();
+ this.lockinPeriod = product.lockinPeriod;
+ this.lockinPeriodType = product.lockinPeriodType;
+ this.isLockinPeriodAllowed = product.isLockinPeriodAllowed;
this.currencyOptions = currencyOptions;
this.interestCompoundedEveryPeriodTypeOptions = interestCompoundedEveryPeriodTypeOptions;
@@ -180,11 +184,11 @@ public class DepositProductData {
}
public BigDecimal getMinimumBalance() {
- return minimumBalance;
+ return minDeposit;
}
public BigDecimal getMaximumBalance() {
- return maximumBalance;
+ return maxDeposit;
}
public Integer getTenureInMonths() {
@@ -192,15 +196,15 @@ public class DepositProductData {
}
public BigDecimal getMaturityDefaultInterestRate() {
- return maturityDefaultInterestRate;
+ return defaultInterestRate;
}
public BigDecimal getMaturityMinInterestRate() {
- return maturityMinInterestRate;
+ return minInterestRate;
}
public BigDecimal getMaturityMaxInterestRate() {
- return maturityMaxInterestRate;
+ return maxInterestRate;
}
public Integer getInterestCompoundedEvery() {
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/domain/DepositProduct.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/domain/DepositProduct.java
index 2663c2ad0..d3d2a49cf 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/domain/DepositProduct.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/domain/DepositProduct.java
@@ -42,11 +42,14 @@ public class DepositProduct extends AbstractPersistable {
@Embedded
private MonetaryCurrency currency;
- @Column(name = "minimum_balance", scale = 6, precision = 19, nullable = false)
- private BigDecimal minimumBalance;
+ @Column(name = "min_deposit", scale = 6, precision = 19, nullable = false)
+ private BigDecimal minDeposit;
+
+ @Column(name = "default_deposit", scale = 6, precision = 19, nullable = false)
+ private BigDecimal defaultDeposit;
- @Column(name = "maximum_balance", scale = 6, precision = 19, nullable = false)
- private BigDecimal maximumBalance;
+ @Column(name = "max_deposit", scale = 6, precision = 19, nullable = false)
+ private BigDecimal maxDeposit;
@Column(name = "interest_compounded_every", nullable = false)
private Integer interestCompoundedEvery;
@@ -54,14 +57,14 @@ public class DepositProduct extends AbstractPersistable {
@Column(name = "interest_compounded_every_period_enum", nullable = false)
private PeriodFrequencyType interestCompoundedEveryPeriodType;
- @Column(name = "maturity_default_interest_rate", scale = 6, precision = 19, nullable = false)
- private BigDecimal maturityDefaultInterestRate;
+ @Column(name = "default_interest_rate", scale = 6, precision = 19, nullable = false)
+ private BigDecimal defaultInterestRate;
- @Column(name = "maturity_min_interest_rate", scale = 6, precision = 19, nullable = false)
- private BigDecimal maturityMinInterestRate;
+ @Column(name = "min_interest_rate", scale = 6, precision = 19, nullable = false)
+ private BigDecimal minInterestRate;
- @Column(name = "maturity_max_interest_rate", scale = 6, precision = 19, nullable = false)
- private BigDecimal maturityMaxInterestRate;
+ @Column(name = "max_interest_rate", scale = 6, precision = 19, nullable = false)
+ private BigDecimal maxInterestRate;
@Column(name = "tenure_months", nullable = false)
private Integer tenureInMonths;
@@ -97,13 +100,14 @@ public class DepositProduct extends AbstractPersistable {
final Integer digitsAfterDecimal = command.integerValueOfParameterNamed("digitsAfterDecimal");
final MonetaryCurrency currency = new MonetaryCurrency(currencyCode, digitsAfterDecimal);
- final BigDecimal minimumBalance = command.bigDecimalValueOfParameterNamed("minimumBalance");
- final BigDecimal maximumBalance = command.bigDecimalValueOfParameterNamed("maximumBalance");
+ final BigDecimal minDeposit = command.bigDecimalValueOfParameterNamed("minDeposit");
+ final BigDecimal defaultDeposit = command.bigDecimalValueOfParameterNamed("defaultDeposit");
+ final BigDecimal maxDeposit = command.bigDecimalValueOfParameterNamed("maxDeposit");
final Integer tenureMonths = command.integerValueOfParameterNamed("tenureInMonths");
- final BigDecimal maturityDefaultInterestRate = command.bigDecimalValueOfParameterNamed("maturityDefaultInterestRate");
- final BigDecimal maturityMinInterestRate = command.bigDecimalValueOfParameterNamed("maturityMinInterestRate");
- final BigDecimal maturityMaxInterestRate = command.bigDecimalValueOfParameterNamed("maturityMaxInterestRate");
+ final BigDecimal defaultInterestRate = command.bigDecimalValueOfParameterNamed("defaultInterestRate");
+ final BigDecimal minInterestRate = command.bigDecimalValueOfParameterNamed("minInterestRate");
+ final BigDecimal maxInterestRate = command.bigDecimalValueOfParameterNamed("maxInterestRate");
final Integer interestCompoundedEvery = command.integerValueOfParameterNamed("interestCompoundedEvery");
final boolean canRenew = command.booleanPrimitiveValueOfParameterNamed("canRenew");
@@ -113,8 +117,8 @@ public class DepositProduct extends AbstractPersistable {
final boolean isLockinPeriodAllowed = command.booleanPrimitiveValueOfParameterNamed("isLockinPeriodAllowed");
final Integer lockinPeriod = command.integerValueOfParameterNamed("lockinPeriod");
- return new DepositProduct(name, externalId, description, currency, minimumBalance, maximumBalance, tenureMonths,
- maturityDefaultInterestRate, maturityMinInterestRate, maturityMaxInterestRate, interestCompoundedEvery,
+ return new DepositProduct(name, externalId, description, currency, minDeposit, defaultDeposit, maxDeposit, tenureMonths,
+ defaultInterestRate, minInterestRate, maxInterestRate, interestCompoundedEvery,
interestCompoundingPeriodType, canRenew, canPreClose, preClosureInterestRate, isInterestCompoundingAllowed,
isLockinPeriodAllowed, lockinPeriod, lockinPeriodType);
}
@@ -124,9 +128,9 @@ public class DepositProduct extends AbstractPersistable {
}
private DepositProduct(final String name, final String externalId, final String description, final MonetaryCurrency currency,
- final BigDecimal minimumBalance, final BigDecimal maximumBalance, final Integer tenureMonths,
- final BigDecimal maturityDefaultInterestRate, final BigDecimal maturityMinInterestRate,
- final BigDecimal maturityMaxInterestRate, final Integer interestCompoundedEvery,
+ final BigDecimal minDeposit, final BigDecimal defaultDeposit, final BigDecimal maxDeposit, final Integer tenureMonths,
+ final BigDecimal defaultInterestRate, final BigDecimal minInterestRate,
+ final BigDecimal maxInterestRate, final Integer interestCompoundedEvery,
final PeriodFrequencyType interestCompoundedEveryPeriodType, final boolean canRenew, final boolean canPreClose,
final BigDecimal preClosureInterestRate, final boolean isInterestCompoundingAllowed, final boolean isLockinPeriodAllowed,
final Integer lockinPeriod, final PeriodFrequencyType lockinPeriodType) {
@@ -143,12 +147,13 @@ public class DepositProduct extends AbstractPersistable {
}
this.currency = currency;
- this.minimumBalance = minimumBalance;
- this.maximumBalance = maximumBalance;
+ this.minDeposit = minDeposit;
+ this.defaultDeposit = defaultDeposit;
+ this.maxDeposit = maxDeposit;
this.tenureInMonths = tenureMonths;
- this.maturityDefaultInterestRate = maturityDefaultInterestRate;
- this.maturityMinInterestRate = maturityMinInterestRate;
- this.maturityMaxInterestRate = maturityMaxInterestRate;
+ this.defaultInterestRate = defaultInterestRate;
+ this.minInterestRate = minInterestRate;
+ this.maxInterestRate = maxInterestRate;
this.interestCompoundedEvery = interestCompoundedEvery;
this.interestCompoundedEveryPeriodType = interestCompoundedEveryPeriodType;
this.renewalAllowed = canRenew;
@@ -176,12 +181,12 @@ public class DepositProduct extends AbstractPersistable {
return tenureInMonths;
}
- public BigDecimal getMaturityDefaultInterestRate() {
- return maturityDefaultInterestRate;
+ public BigDecimal getDefaultInterestRate() {
+ return defaultInterestRate;
}
- public BigDecimal getMaturityMinInterestRate() {
- return maturityMinInterestRate;
+ public BigDecimal getMinInterestRate() {
+ return minInterestRate;
}
public BigDecimal getPreClosureInterestRate() {
@@ -275,20 +280,28 @@ public class DepositProduct extends AbstractPersistable {
this.currency = new MonetaryCurrency(currencyCode, digitsAfterDecimal);
}
- final String minimumBalanceParamName = "minimumBalance";
- if (command.isChangeInBigDecimalParameterNamed(minimumBalanceParamName, this.minimumBalance)) {
- final BigDecimal newValue = command.bigDecimalValueOfParameterNamed(minimumBalanceParamName);
- actualChanges.put(minimumBalanceParamName, newValue);
+ final String minDepositParamName = "minDeposit";
+ if (command.isChangeInBigDecimalParameterNamed(minDepositParamName, this.minDeposit)) {
+ final BigDecimal newValue = command.bigDecimalValueOfParameterNamed(minDepositParamName);
+ actualChanges.put(minDepositParamName, newValue);
actualChanges.put("locale", localeAsInput);
- this.minimumBalance = newValue;
+ this.minDeposit = newValue;
+ }
+
+ final String defaultDepositParamName = "defaultDeposit";
+ if (command.isChangeInBigDecimalParameterNamed(defaultDepositParamName, this.defaultDeposit)) {
+ final BigDecimal newValue = command.bigDecimalValueOfParameterNamed(defaultDepositParamName);
+ actualChanges.put(defaultDepositParamName, newValue);
+ actualChanges.put("locale", localeAsInput);
+ this.defaultDeposit = newValue;
}
- final String maximumBalanceParamName = "maximumBalance";
- if (command.isChangeInBigDecimalParameterNamed(maximumBalanceParamName, this.maximumBalance)) {
- final BigDecimal newValue = command.bigDecimalValueOfParameterNamed(maximumBalanceParamName);
- actualChanges.put(maximumBalanceParamName, newValue);
+ final String maxDepositParamName = "maxDeposit";
+ if (command.isChangeInBigDecimalParameterNamed(maxDepositParamName, this.maxDeposit)) {
+ final BigDecimal newValue = command.bigDecimalValueOfParameterNamed(maxDepositParamName);
+ actualChanges.put(maxDepositParamName, newValue);
actualChanges.put("locale", localeAsInput);
- this.maximumBalance = newValue;
+ this.maxDeposit = newValue;
}
final String tenureInMonthsParamName = "tenureInMonths";
@@ -299,28 +312,28 @@ public class DepositProduct extends AbstractPersistable {
this.tenureInMonths = newValue;
}
- final String defaultInterestRateParamName = "maturityDefaultInterestRate";
- if (command.isChangeInBigDecimalParameterNamed(defaultInterestRateParamName, this.maturityDefaultInterestRate)) {
+ final String defaultInterestRateParamName = "defaultInterestRate";
+ if (command.isChangeInBigDecimalParameterNamed(defaultInterestRateParamName, this.defaultInterestRate)) {
final BigDecimal newValue = command.bigDecimalValueOfParameterNamed(defaultInterestRateParamName);
actualChanges.put(defaultInterestRateParamName, newValue);
actualChanges.put("locale", localeAsInput);
- this.maturityDefaultInterestRate = newValue;
+ this.defaultInterestRate = newValue;
}
- final String minInterestRateParamName = "maturityMinInterestRate";
- if (command.isChangeInBigDecimalParameterNamed(minInterestRateParamName, this.maturityMinInterestRate)) {
+ final String minInterestRateParamName = "minInterestRate";
+ if (command.isChangeInBigDecimalParameterNamed(minInterestRateParamName, this.minInterestRate)) {
final BigDecimal newValue = command.bigDecimalValueOfParameterNamed(minInterestRateParamName);
actualChanges.put(minInterestRateParamName, newValue);
actualChanges.put("locale", localeAsInput);
- this.maturityMinInterestRate = newValue;
+ this.minInterestRate = newValue;
}
- final String maxInterestRateParamName = "maturityMaxInterestRate";
- if (command.isChangeInBigDecimalParameterNamed(maxInterestRateParamName, this.maturityMaxInterestRate)) {
+ final String maxInterestRateParamName = "maxInterestRate";
+ if (command.isChangeInBigDecimalParameterNamed(maxInterestRateParamName, this.maxInterestRate)) {
final BigDecimal newValue = command.bigDecimalValueOfParameterNamed(maxInterestRateParamName);
actualChanges.put(maxInterestRateParamName, newValue);
actualChanges.put("locale", localeAsInput);
- this.maturityMaxInterestRate = newValue;
+ this.maxInterestRate = newValue;
}
final String interestCompoundedEveryParamName = "interestCompoundedEvery";
@@ -401,36 +414,36 @@ public class DepositProduct extends AbstractPersistable {
public void validateInterestRateInRange(final BigDecimal interestRate) {
boolean inRange = true;
- if (interestRate.compareTo(this.maturityMinInterestRate) < 0) {
+ if (interestRate.compareTo(this.minInterestRate) < 0) {
inRange = false;
}
- if (this.maturityMaxInterestRate.compareTo(interestRate) < 0) {
+ if (this.maxInterestRate.compareTo(interestRate) < 0) {
inRange = false;
}
if (!inRange) {
final String actualValue = interestRate.toPlainString();
- final String minValue = (this.maturityMinInterestRate == null) ? "" : this.maturityMinInterestRate.toPlainString();
- final String maxValue = (this.maturityMaxInterestRate == null) ? "" : this.maturityMaxInterestRate.toPlainString();
+ final String minValue = (this.minInterestRate == null) ? "" : this.minInterestRate.toPlainString();
+ final String maxValue = (this.maxInterestRate == null) ? "" : this.maxInterestRate.toPlainString();
throw new DepositProductValueOutsideRangeException(actualValue, minValue, maxValue, "deposit.account.maturityInterestRate");
}
}
public void validateDepositInRange(final BigDecimal depositAmount) {
boolean inRange = true;
- if (depositAmount.compareTo(this.minimumBalance) < 0) {
+ if (depositAmount.compareTo(this.minDeposit) < 0) {
inRange = false;
}
- if (this.maximumBalance != null && this.maximumBalance.compareTo(depositAmount) < 0) {
+ if (this.maxDeposit != null && this.maxDeposit.compareTo(depositAmount) < 0) {
inRange = false;
}
if (!inRange) {
final String actualValue = depositAmount.toPlainString();
- final String minValue = (this.minimumBalance == null) ? "" : this.minimumBalance.toPlainString();
- final String maxValue = (this.maximumBalance == null) ? "" : this.maximumBalance.toPlainString();
+ final String minValue = (this.minDeposit == null) ? "" : this.minDeposit.toPlainString();
+ final String maxValue = (this.maxDeposit == null) ? "" : this.maxDeposit.toPlainString();
throw new DepositProductValueOutsideRangeException(actualValue, minValue, maxValue, "deposit.account.deposit.amount");
}
}
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/serialization/DepositProductCommandFromApiJsonDeserializer.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/serialization/DepositProductCommandFromApiJsonDeserializer.java
index a5523300f..94b0a7673 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/serialization/DepositProductCommandFromApiJsonDeserializer.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/serialization/DepositProductCommandFromApiJsonDeserializer.java
@@ -29,8 +29,8 @@ public final class DepositProductCommandFromApiJsonDeserializer {
* The parameters supported for this command.
*/
private final Set supportedParams = new HashSet(Arrays.asList("locale", "name", "externalId", "description",
- "currencyCode", "digitsAfterDecimal", "minimumBalance", "maximumBalance", "tenureInMonths", "maturityDefaultInterestRate",
- "maturityMinInterestRate", "maturityMaxInterestRate", "interestCompoundedEvery", "interestCompoundedEveryPeriodType",
+ "currencyCode", "digitsAfterDecimal", "minDeposit", "defaultDeposit", "maxDeposit", "tenureInMonths", "defaultInterestRate",
+ "minInterestRate", "maxInterestRate", "interestCompoundedEvery", "interestCompoundedEveryPeriodType",
"renewalAllowed", "preClosureAllowed", "preClosureInterestRate", "interestCompoundingAllowed", "isLockinPeriodAllowed",
"lockinPeriod", "lockinPeriodType"));
@@ -71,34 +71,39 @@ public final class DepositProductCommandFromApiJsonDeserializer {
final Integer digitsAfterDecimal = fromApiJsonHelper.extractIntegerNamed("digitsAfterDecimal", element, Locale.getDefault());
baseDataValidator.reset().parameter("digitsAfterDecimal").value(digitsAfterDecimal).notNull().inMinMaxRange(0, 6);
- final BigDecimal minimumBalance = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("minimumBalance", element);
- baseDataValidator.reset().parameter("minimumBalance").value(minimumBalance).notNull().zeroOrPositiveAmount();
+ final BigDecimal minDeposit = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("minDeposit", element);
+ baseDataValidator.reset().parameter("minDeposit").value(minDeposit).notNull().zeroOrPositiveAmount();
+
+ final BigDecimal defaultDeposit = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("defaultDeposit", element);
+ baseDataValidator.reset().parameter("defaultDeposit").value(defaultDeposit).notNull().zeroOrPositiveAmount();
- if (fromApiJsonHelper.parameterExists("maximumBalance", element)) {
- final BigDecimal maximumBalance = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("maximumBalance", element);
- baseDataValidator.reset().parameter("maximumBalance").value(maximumBalance).zeroOrPositiveAmount();
- baseDataValidator.reset().parameter("minimumBalance").comapareMinimumAndMaximumAmounts(minimumBalance, maximumBalance);
+ if (fromApiJsonHelper.parameterExists("maxDeposit", element)) {
+ final BigDecimal maxDeposit = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("maxDeposit", element);
+ baseDataValidator.reset().parameter("maxDeposit").value(maxDeposit).notNull().zeroOrPositiveAmount();
+ baseDataValidator.reset().parameter("minDeposit").comapareMinimumAndMaximumAmounts(minDeposit, maxDeposit);
+ baseDataValidator.reset().parameter("defaultDeposit").comapareMinimumAndMaximumAmounts(defaultDeposit, maxDeposit);
+ baseDataValidator.reset().parameter("minDeposit").comapareMinimumAndMaximumAmounts(minDeposit, defaultDeposit);
}
final Integer tenureInMonths = fromApiJsonHelper.extractIntegerNamed("tenureInMonths", element, Locale.getDefault());
baseDataValidator.reset().parameter("tenureInMonths").value(tenureInMonths).notNull().zeroOrPositiveAmount();
- final BigDecimal maturityDefaultInterestRate = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("maturityDefaultInterestRate",
+ final BigDecimal defaultInterestRate = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("defaultInterestRate",
element);
- baseDataValidator.reset().parameter("maturityDefaultInterestRate").value(maturityDefaultInterestRate).notNull()
+ baseDataValidator.reset().parameter("defaultInterestRate").value(defaultInterestRate).notNull()
.zeroOrPositiveAmount();
- final BigDecimal maturityMinInterestRate = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("maturityMinInterestRate", element);
- baseDataValidator.reset().parameter("maturityMinInterestRate").value(maturityMinInterestRate).notNull().zeroOrPositiveAmount();
+ final BigDecimal minInterestRate = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("minInterestRate", element);
+ baseDataValidator.reset().parameter("minInterestRate").value(minInterestRate).notNull().zeroOrPositiveAmount();
- final BigDecimal maturityMaxInterestRate = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("maturityMaxInterestRate", element);
- baseDataValidator.reset().parameter("maturityMaxInterestRate").value(maturityMaxInterestRate).notNull().zeroOrPositiveAmount();
- baseDataValidator.reset().parameter("maturityMinInterestRate")
- .comapareMinAndMaxOfTwoBigDecmimalNos(maturityMinInterestRate, maturityMaxInterestRate);
- baseDataValidator.reset().parameter("maturityDefaultInterestRate")
- .comapareMinAndMaxOfTwoBigDecmimalNos(maturityDefaultInterestRate, maturityMaxInterestRate);
- baseDataValidator.reset().parameter("maturityMinInterestRate")
- .comapareMinAndMaxOfTwoBigDecmimalNos(maturityMinInterestRate, maturityDefaultInterestRate);
+ final BigDecimal maxInterestRate = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("maxInterestRate", element);
+ baseDataValidator.reset().parameter("maxInterestRate").value(maxInterestRate).notNull().zeroOrPositiveAmount();
+ baseDataValidator.reset().parameter("minInterestRate")
+ .comapareMinAndMaxOfTwoBigDecmimalNos(minInterestRate, maxInterestRate);
+ baseDataValidator.reset().parameter("defaultInterestRate")
+ .comapareMinAndMaxOfTwoBigDecmimalNos(defaultInterestRate, maxInterestRate);
+ baseDataValidator.reset().parameter("minInterestRate")
+ .comapareMinAndMaxOfTwoBigDecmimalNos(minInterestRate, defaultInterestRate);
final Integer interestCompoundedEvery = fromApiJsonHelper.extractIntegerNamed("interestCompoundedEvery", element,
Locale.getDefault());
@@ -124,17 +129,17 @@ public final class DepositProductCommandFromApiJsonDeserializer {
final BigDecimal preClosureInterestRate = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("preClosureInterestRate", element);
baseDataValidator.reset().parameter("preClosureInterestRate").value(preClosureInterestRate).notNull().zeroOrPositiveAmount();
baseDataValidator.reset().parameter("preClosureInterestRate")
- .comapareMinAndMaxOfTwoBigDecmimalNos(preClosureInterestRate, maturityMinInterestRate);
+ .comapareMinAndMaxOfTwoBigDecmimalNos(preClosureInterestRate, minInterestRate);
final Boolean isLockinPeriodAllowed = fromApiJsonHelper.extractBooleanNamed("isLockinPeriodAllowed", element);
baseDataValidator.reset().parameter("isLockinPeriodAllowed").value(isLockinPeriodAllowed)
.trueOrFalseRequired(isBooleanValueUpdated(isLockinPeriodAllowed));
final Integer lockinPeriod = fromApiJsonHelper.extractIntegerNamed("lockinPeriod", element, Locale.getDefault());
- baseDataValidator.reset().parameter("lockinPeriod").value(lockinPeriod).notNull().zeroOrPositiveAmount();
+ baseDataValidator.reset().parameter("lockinPeriod").value(lockinPeriod).ignoreIfNull().zeroOrPositiveAmount();
final Integer lockinPeriodType = fromApiJsonHelper.extractIntegerNamed("lockinPeriodType", element, Locale.getDefault());
- baseDataValidator.reset().parameter("lockinPeriodType").value(lockinPeriodType).notNull().inMinMaxRange(1, 3);
+ baseDataValidator.reset().parameter("lockinPeriodType").value(lockinPeriodType).ignoreIfNull().inMinMaxRange(1, 3);
throwExceptionIfValidationWarningsExist(dataValidationErrors);
}
@@ -165,32 +170,37 @@ public final class DepositProductCommandFromApiJsonDeserializer {
final Integer digitsAfterDecimal = fromApiJsonHelper.extractIntegerNamed("digitsAfterDecimal", element, Locale.getDefault());
baseDataValidator.reset().parameter("digitsAfterDecimal").value(digitsAfterDecimal).ignoreIfNull().inMinMaxRange(0, 6);
- final BigDecimal minimumBalance = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("minimumBalance", element);
- baseDataValidator.reset().parameter("minimumBalance").value(minimumBalance).ignoreIfNull().zeroOrPositiveAmount();
+ final BigDecimal minDeposit = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("minDeposit", element);
+ baseDataValidator.reset().parameter("minDeposit").value(minDeposit).ignoreIfNull().zeroOrPositiveAmount();
+
+ final BigDecimal defaultDeposit = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("defaultDeposit", element);
+ baseDataValidator.reset().parameter("defaultDeposit").value(defaultDeposit).ignoreIfNull().zeroOrPositiveAmount();
- final BigDecimal maximumBalance = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("maximumBalance", element);
- baseDataValidator.reset().parameter("maximumBalance").value(maximumBalance).ignoreIfNull().zeroOrPositiveAmount();
- baseDataValidator.reset().parameter("minimumBalance").comapareMinimumAndMaximumAmounts(minimumBalance, maximumBalance);
+ final BigDecimal maxDeposit = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("maxDeposit", element);
+ baseDataValidator.reset().parameter("maxDeposit").value(maxDeposit).ignoreIfNull().zeroOrPositiveAmount();
+ baseDataValidator.reset().parameter("minDeposit").comapareMinimumAndMaximumAmounts(minDeposit, maxDeposit);
+ baseDataValidator.reset().parameter("defaultDeposit").comapareMinimumAndMaximumAmounts(defaultDeposit, maxDeposit);
+ baseDataValidator.reset().parameter("minDeposit").comapareMinimumAndMaximumAmounts(minDeposit, defaultDeposit);
final Integer tenureInMonths = fromApiJsonHelper.extractIntegerNamed("tenureInMonths", element, Locale.getDefault());
baseDataValidator.reset().parameter("tenureInMonths").value(tenureInMonths).ignoreIfNull().zeroOrPositiveAmount();
- final BigDecimal maturityDefaultInterestRate = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("maturityDefaultInterestRate",
+ final BigDecimal defaultInterestRate = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("defaultInterestRate",
element);
- baseDataValidator.reset().parameter("maturityDefaultInterestRate").value(maturityDefaultInterestRate).ignoreIfNull()
+ baseDataValidator.reset().parameter("defaultInterestRate").value(defaultInterestRate).ignoreIfNull()
.zeroOrPositiveAmount();
- final BigDecimal maturityMinInterestRate = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("maturityMinInterestRate", element);
- baseDataValidator.reset().parameter("maturityMinInterestRate").value(maturityMinInterestRate).ignoreIfNull().zeroOrPositiveAmount();
+ final BigDecimal minInterestRate = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("minInterestRate", element);
+ baseDataValidator.reset().parameter("minInterestRate").value(minInterestRate).ignoreIfNull().zeroOrPositiveAmount();
- final BigDecimal maturityMaxInterestRate = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("maturityMaxInterestRate", element);
- baseDataValidator.reset().parameter("maturityMaxInterestRate").value(maturityMaxInterestRate).ignoreIfNull().zeroOrPositiveAmount();
- baseDataValidator.reset().parameter("maturityMinInterestRate")
- .comapareMinAndMaxOfTwoBigDecmimalNos(maturityMinInterestRate, maturityMaxInterestRate);
- baseDataValidator.reset().parameter("maturityDefaultInterestRate")
- .comapareMinAndMaxOfTwoBigDecmimalNos(maturityDefaultInterestRate, maturityMaxInterestRate);
- baseDataValidator.reset().parameter("maturityMinInterestRate")
- .comapareMinAndMaxOfTwoBigDecmimalNos(maturityMinInterestRate, maturityDefaultInterestRate);
+ final BigDecimal maxInterestRate = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("maxInterestRate", element);
+ baseDataValidator.reset().parameter("maxInterestRate").value(maxInterestRate).ignoreIfNull().zeroOrPositiveAmount();
+ baseDataValidator.reset().parameter("minInterestRate")
+ .comapareMinAndMaxOfTwoBigDecmimalNos(minInterestRate, maxInterestRate);
+ baseDataValidator.reset().parameter("defaultInterestRate")
+ .comapareMinAndMaxOfTwoBigDecmimalNos(defaultInterestRate, maxInterestRate);
+ baseDataValidator.reset().parameter("minInterestRate")
+ .comapareMinAndMaxOfTwoBigDecmimalNos(minInterestRate, defaultInterestRate);
final Integer interestCompoundedEvery = fromApiJsonHelper.extractIntegerNamed("interestCompoundedEvery", element,
Locale.getDefault());
@@ -216,7 +226,7 @@ public final class DepositProductCommandFromApiJsonDeserializer {
final BigDecimal preClosureInterestRate = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("preClosureInterestRate", element);
baseDataValidator.reset().parameter("preClosureInterestRate").value(preClosureInterestRate).ignoreIfNull().zeroOrPositiveAmount();
baseDataValidator.reset().parameter("preClosureInterestRate")
- .comapareMinAndMaxOfTwoBigDecmimalNos(preClosureInterestRate, maturityMinInterestRate);
+ .comapareMinAndMaxOfTwoBigDecmimalNos(preClosureInterestRate, minInterestRate);
final Boolean lockinPeriodAllowed = fromApiJsonHelper.extractBooleanNamed("isLockinPeriodAllowed", element);
baseDataValidator.reset().parameter("isLockinPeriodAllowed").value(lockinPeriodAllowed).ignoreIfNull()
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/service/DepositProductReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/service/DepositProductReadPlatformServiceImpl.java
index 4fae2f47d..0c3595542 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/service/DepositProductReadPlatformServiceImpl.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/service/DepositProductReadPlatformServiceImpl.java
@@ -84,10 +84,10 @@ public class DepositProductReadPlatformServiceImpl implements DepositProductRead
public String depositProductSchema() {
return " dp.id as id, dp.external_id as exernalId, dp.name as name, dp.description as description,dp.currency_code as currencyCode, dp.currency_digits as currencyDigits, "
- + "dp.minimum_balance as minimumBalance,dp.maximum_balance as maximumBalance, dp.tenure_months as tenureMonths, "
+ + "dp.min_deposit as minDeposit, dp.default_deposit as defaultDeposit, dp.max_deposit as maxDeposit, dp.tenure_months as tenureMonths, "
+ "dp.interest_compounded_every as interestCompoundedEvery, dp.interest_compounded_every_period_enum as interestCompoundedEveryPeriodType, "
- + "dp.maturity_default_interest_rate as maturityDefaultInterestRate, dp.is_compounding_interest_allowed as interestCompoundingAllowed, "
- + "dp.maturity_min_interest_rate as maturityMinInterestRate, dp.maturity_max_interest_rate as maturityMaxInterestRate, "
+ + "dp.default_interest_rate as defaultInterestRate, dp.is_compounding_interest_allowed as interestCompoundingAllowed, "
+ + "dp.min_interest_rate as minInterestRate, dp.max_interest_rate as maxInterestRate, "
+ "dp.is_renewal_allowed as canRenew, dp.is_preclosure_allowed as canPreClose, dp.pre_closure_interest_rate as preClosureInterestRate, "
+ "dp.is_lock_in_period_allowed as isLockinPeriodAllowed, dp.lock_in_period as lockinPeriod, dp.lock_in_period_type as lockinPeriodType, "
+ "curr.name as currencyName, curr.internationalized_name_code as currencyNameCode, curr.display_symbol as currencyDisplaySymbol "
@@ -109,8 +109,9 @@ public class DepositProductReadPlatformServiceImpl implements DepositProductRead
String currencyDisplaySymbol = rs.getString("currencyDisplaySymbol");
CurrencyData currencyData = new CurrencyData(currencyCode, currencyName, currencyDigits, currencyDisplaySymbol, currencyNameCode);
- BigDecimal minimumBalance = rs.getBigDecimal("minimumBalance");
- BigDecimal maximumBalance = rs.getBigDecimal("maximumBalance");
+ BigDecimal minDeposit = rs.getBigDecimal("minDeposit");
+ BigDecimal defaultDeposit = rs.getBigDecimal("defaultDeposit");
+ BigDecimal maxDeposit = rs.getBigDecimal("maxDeposit");
Integer tenureMonths = JdbcSupport.getInteger(rs, "tenureMonths");
Integer interestCompoundedEvery = JdbcSupport.getInteger(rs, "interestCompoundedEvery");
@@ -118,9 +119,9 @@ public class DepositProductReadPlatformServiceImpl implements DepositProductRead
EnumOptionData interestCompoundedEveryPeriodType = SavingsDepositEnumerations
.interestCompoundingPeriodType(interestCompoundedEveryPeriodTypeValue);
- BigDecimal maturityDefaultInterestRate = rs.getBigDecimal("maturityDefaultInterestRate");
- BigDecimal maturityMinInterestRate = rs.getBigDecimal("maturityMinInterestRate");
- BigDecimal maturityMaxInterestRate = rs.getBigDecimal("maturityMaxInterestRate");
+ BigDecimal defaultInterestRate = rs.getBigDecimal("defaultInterestRate");
+ BigDecimal minInterestRate = rs.getBigDecimal("minInterestRate");
+ BigDecimal maxInterestRate = rs.getBigDecimal("maxInterestRate");
Boolean canRenew = rs.getBoolean("canRenew");
Boolean canPreClose = rs.getBoolean("canPreClose");
@@ -134,8 +135,8 @@ public class DepositProductReadPlatformServiceImpl implements DepositProductRead
EnumOptionData lockinPeriodType = SavingsDepositEnumerations.interestCompoundingPeriodType(lockinPeriodTypeValue);
return new DepositProductData(id, exernalId, name, description, currencyCode, currencyDigits,
- minimumBalance, maximumBalance, tenureMonths, maturityDefaultInterestRate, maturityMinInterestRate,
- maturityMaxInterestRate, interestCompoundedEvery, interestCompoundedEveryPeriodType, canRenew, canPreClose,
+ minDeposit, defaultDeposit, maxDeposit, tenureMonths, defaultInterestRate, minInterestRate,
+ maxInterestRate, interestCompoundedEvery, interestCompoundedEveryPeriodType, canRenew, canPreClose,
preClosureInterestRate, interestCompoundingAllowed, isLockinPeriodAllowed, lockinPeriod, lockinPeriodType, currencyData);
}
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/service/DepositProductWritePlatformServiceJpaRepositoryImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/service/DepositProductWritePlatformServiceJpaRepositoryImpl.java
index 9cfd0d4c6..27f00684b 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/service/DepositProductWritePlatformServiceJpaRepositoryImpl.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositproduct/service/DepositProductWritePlatformServiceJpaRepositoryImpl.java
@@ -72,11 +72,14 @@ public class DepositProductWritePlatformServiceJpaRepositoryImpl implements Depo
this.context.authenticatedUser();
this.fromApiJsonDeserializer.validateForCreate(command.json());
+ PeriodFrequencyType lockinPeriodType = null;
final Integer interestCompoundingPeriodTypeIntValue = command.integerValueOfParameterNamed("interestCompoundedEveryPeriodType");
PeriodFrequencyType interestCompoundingPeriodType = PeriodFrequencyType.fromInt(interestCompoundingPeriodTypeIntValue);
final Integer lockinPeriodTypeIntValue = command.integerValueOfParameterNamed("lockinPeriodType");
- PeriodFrequencyType lockinPeriodType = PeriodFrequencyType.fromInt(lockinPeriodTypeIntValue);
+ if (lockinPeriodTypeIntValue != null) {
+ lockinPeriodType = PeriodFrequencyType.fromInt(lockinPeriodTypeIntValue);
+ }
DepositProduct product = DepositProduct.assembleFromJson(command, interestCompoundingPeriodType, lockinPeriodType);