diff --git a/api-docs/apiLive.htm b/api-docs/apiLive.htm index 1dc3f13f1..6589ef81a 100644 --- a/api-docs/apiLive.htm +++ b/api-docs/apiLive.htm @@ -458,6 +458,38 @@ Update a Charge Delete a Charge + + DEPOSIT PRODUCT + depositproducts + Create a Deposit product + List Deposit products + + + + + + depositproducts/{prodcutId} + + Retrieve a Deposit product + Update a Deposit product + Delete a Deposit product + + + SAVING PRODUCT + savingproducts + Create a Saving product + List Saving products + + + + + + savingproducts/{prodcutId} + + Retrieve a Saving procduct + Update a Saving product + Delete a Saving product + @@ -873,6 +905,16 @@ Retrieve Audit Search Data + + depositproducts/template + Retrieve Deposit + Product Details Template + + + loanproducts/template + Retrieve Saving + Product Details Template + @@ -2942,33 +2984,39 @@ Request Body: If provided, it must be unique. tenureInMonths: - denotes the tenure period of deposit account. + The time period for fixed deposit to mature(in months).
+ Eg:The period of deposit shall be 24 months
+ tenureInMonths=24. + renewalAllowed: - Whether the deposit account is eligible for renew after maturity.
- If 'true' : renewalAllowed otherwise renewal not allowed. + Used to renew the deposit account after maturity. +
if 'true' the account is eligible for renew. + isInterestWithdrawable: - denotes whether for this deposit account, interest is withdrawable or not
- If true interest is withdrawable and 'interestCompoundingAllowed' must be false. + Denotes whether one can withdraw the interest from deposit account. interestCompoundingAllowed: - denotes interestCompounding is allowed or not for a deposit account
- If 'false' on simple interest basis the interest is calculated + Denotes whether the interest is calculated on compounding basis or not.
+ if true:interest calculated on compounding basis, else interest calculated on simple calculation basis. + maturityInterestRate: - Interest rate applicable on deposit amount upto maturity date,
- after maturrity if the account is not closed 'preClosureInterestRate' is applicable on deposit amount + Denotes the interest rate % on deposit amount. preClosureInterestRate: - Interest rate applicable on deposit amount if the account is closed before maturity date,
- and after maturity of account if it is not closed or renewed this interest rate is applicable. + Denotes the interest rate % of deposit amount for preclosing accounts.
+ This rate is applicable if the account is preclosed. + interestCompoundedEvery: - Interest is calculated on deposit account for every interestCompoundedEvery period + Interest is calculated on deposit amount for every interestCompoundedEvery period lockinPeriod: - Within a lockinperiod, the deposit account cannot be preclosed + Defines a lockin period for deposit account.
+ With in the lockin period one cannot preclose the deposit account. + @@ -2980,19 +3028,19 @@ Request Body:

Retrieve Deposit Account Details Template:

-

This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of: -

-

+

This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of: +

+

Arguments

clientId
Integer mandatory
productId
Integer optional
-
If entered, productId, productName and selectedProduct fields are returned.
+
If entered productId, productName and selectedProduct fields are returned.

Example Requests:

depositaccounts/template?clientId=17&productId=1
@@ -5566,7 +5614,973 @@ Content-Type: application/json { "resourceId": 1 }
+ + + +   +
+
+

Deposit Products :

+

A Deposit product is a template that is used when creating a Fixed Deposit Account. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Field Descriptions
digitsAfterDecimal
Override the currency default value for digitsAfterDecimal.
minimumBalance :
Minimum deposit amount that is required to create a deposit account.
maximumBalance :
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
Default interest rate for Fixed Deposit product
+ e.g. 12
maturityMinInterestRate
Minimum supported interest rate for Fixed Deposit product
+ e.g. 8
maturityMaxInterestRate
Maximum supported interest rate for Fixed Deposit product
+ e.g. 14
renewalAllowed
Allows to renew the deposit account on maturity
+ Used like: renewalAllowed:true
preClosureAllowed
Support for pre-closing a Fixed deposit account before maturity
+ If 'true' : preClosureAllowed else preClosure is not allowed.
preClosureInterestRate
Denotes the interest rate for deposit accounts for pre-closure accounts.
+ This rate is applicable if the account is pre-closed / Before maturity.
interestCompoundingAllowed
Denotes whether the interest is calculated on compounding basis or not.
+ if true:interest calculated on compounding basis, else interest calculated on simple calculation basis.
isLockinPeriodAllowed
This will allow to set the lock-in period for a fixed deposit product
+ If 'true' :isLockinPeriodAllowed otherwise isLockinPeriod not allowed
lockinPeriod
Defines a lock-in period for deposit account.
+
+
+ +   +
+
+

List DepositProducts

+

Example Requests:

+
depositproducts
+

+
depositproducts?fields=name, ......
+
+
+ GET https://Domain Name/api/v1/depositproducts + +[{ + "id": 1, + "name": "Test", + "description": "asdf", + "currencyCode": "USD", + "digitsAfterDecimal": 2, + "minimumBalance": 100.000000, + "maximumBalance": 1000.000000, + "tenureInMonths": 12, + "maturityDefaultInterestRate": 12.000000, + "maturityMinInterestRate": 8.000000, + "maturityMaxInterestRate": 12.000000, + "interestCompoundedEvery": 1, + "interestCompoundedEveryPeriodType": { + "id": 2, + "code": "deposit.interest.compounding.period.periodFrequencyType.months", + "value": "Months" + }, + "currency": { + "code": "USD", + "name": "US Dollar", + "decimalPlaces": 2, + "displaySymbol": "$", + "nameCode": "currency.USD", + "displayLabel": "US Dollar ($)" + }, + "renewalAllowed": false, + "preClosureAllowed": false, + "preClosureInterestRate": 6.000000, + "interestCompoundingAllowed": true, + "isLockinPeriodAllowed": false, + "lockinPeriod": 2, + "lockinPeriodType": { + "id": 2, + "code": "deposit.interest.compounding.period.periodFrequencyType.months", + "value": "Months" + }, + "createdOn": 1360576753000, + "lastModifedOn": 1360579312000 +}...] + +
+
+ +   +
+
+

Retrieve DepositProduct Details Template

+

This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of: +

+

+

Example Request:

+
depositproducts/template
+
+
+ GET https://Domain Name/api/v1/depositproducts/template + +{ + "interestCompoundedEveryPeriodType": { + "id": 2, + "code": "deposit.interest.compounding.period.periodFrequencyType.months", + "value": "Months" + }, + "currency": { + "code": "USD", + "name": "US Dollar", + "decimalPlaces": 2, + "displaySymbol": "$", + "nameCode": "currency.USD", + "displayLabel": "US Dollar ($)" + }, + "renewalAllowed": false, + "preClosureAllowed": false, + "isLockinPeriodAllowed": false, + "lockinPeriodType": { + "id": 2, + "code": "deposit.interest.compounding.period.periodFrequencyType.months", + "value": "Months" + }, + "currencyOptions": [{ + "code": "USD", + "name": "US Dollar", + "decimalPlaces": 2, + "displaySymbol": "$", + "nameCode": "currency.USD", + "displayLabel": "US Dollar ($)" + }], + "interestCompoundedEveryPeriodTypeOptions": [{ + "id": 2, + "code": "deposit.interest.compounding.period.periodFrequencyType.months", + "value": "Months" + }] +} + +
+
+ +   +
+
+

Retrieve a Deposit Product

+

Example Requests:

+
depositproducts/1
+

+
depositproducts/1?template=true
+

+
depositproducts/1?fields=name,description
+
+
+ GET https://Domain Name/api/v1/depositproducts/1 + +{ + "id": 1, + "name": "Test", + "description": "asdf", + "currencyCode": "USD", + "digitsAfterDecimal": 2, + "minimumBalance": 100, + "maximumBalance": 1000, + "tenureInMonths": 12, + "maturityDefaultInterestRate": 12, + "maturityMinInterestRate": 8, + "maturityMaxInterestRate": 12, + "interestCompoundedEvery": 1, + "interestCompoundedEveryPeriodType": { + "id": 2, + "code": "deposit.interest.compounding.period.periodFrequencyType.months", + "value": "Months" + }, + "currency": { + "code": "USD", + "name": "US Dollar", + "decimalPlaces": 2, + "displaySymbol": "$", + "nameCode": "currency.USD", + "displayLabel": "US Dollar ($)" + }, + "renewalAllowed": false, + "preClosureAllowed": false, + "preClosureInterestRate": 6, + "interestCompoundingAllowed": true, + "isLockinPeriodAllowed": false, + "lockinPeriod": 2, + "lockinPeriodType": { + "id": 2, + "code": "deposit.interest.compounding.period.periodFrequencyType.months", + "value": "Months" + }, + "createdOn": 1360576753000, + "lastModifedOn": 1360579312000 +} + + + GET https://Domain Name/api/v1/depositproducts/1?template=true + +{ + "id": 1, + "name": "Test", + "description": "asdf", + "currencyCode": "USD", + "digitsAfterDecimal": 2, + "minimumBalance": 100.000000, + "maximumBalance": 1000.000000, + "tenureInMonths": 12, + "maturityDefaultInterestRate": 12.000000, + "maturityMinInterestRate": 8.000000, + "maturityMaxInterestRate": 12.000000, + "interestCompoundedEvery": 1, + "interestCompoundedEveryPeriodType": { + "id": 2, + "code": "deposit.interest.compounding.period.periodFrequencyType.months", + "value": "Months" + }, + "currency": { + "code": "USD", + "name": "US Dollar", + "decimalPlaces": 2, + "displaySymbol": "$", + "nameCode": "currency.USD", + "displayLabel": "US Dollar ($)" + }, + "renewalAllowed": false, + "preClosureAllowed": false, + "preClosureInterestRate": 6.000000, + "interestCompoundingAllowed": true, + "isLockinPeriodAllowed": false, + "lockinPeriod": 2, + "lockinPeriodType": { + "id": 2, + "code": "deposit.interest.compounding.period.periodFrequencyType.months", + "value": "Months" + }, + "createdOn": 1360576753000, + "lastModifedOn": 1360579312000, + "currencyOptions": [{ + "code": "USD", + "name": "US Dollar", + "decimalPlaces": 2, + "displaySymbol": "$", + "nameCode": "currency.USD", + "displayLabel": "US Dollar ($)" + }], + "interestCompoundedEveryPeriodTypeOptions": [{ + "id": 2, + "code": "deposit.interest.compounding.period.periodFrequencyType.months", + "value": "Months" + }] +} + +
+
+ +   +
+
+

Create a Deposit Product

+ + + + + +
Mandatory Fields
name, currencyCode, digitsAfterDecimal,interestPostedEvery, minimumBalance, +
+ tenureInMonths, maturityDefaultInterestRate,maturityMinInterestRate, +
+ maturityMaxInterestRate,interestCompoundedEvery,preClosureInterestRate. +
+
+
+ POST https://Domain Name/api/v1/depositproducts + POST depositproducts +Content-Type: application/json +Request Body: +{ + "locale": "en", + "name": "Test", + "description": "asdf", + "currencyCode": "USD", + "digitsAfterDecimal": "2", + "minimumBalance": "100", + "maximumBalance": "1,000", + "tenureInMonths": "12", + "renewalAllowed": "true", + "preClosureAllowed": "false", + "interestCompoundingAllowed": "true", + "isLockinPeriodAllowed": "false", + "maturityDefaultInterestRate": "12", + "maturityMinInterestRate": "8", + "maturityMaxInterestRate": "12", + "preClosureInterestRate": "6", + "interestCompoundedEvery": "1", + "interestCompoundedEveryPeriodType": "2", + "lockinPeriod": "2", + "lockinPeriodType": "2" +} + + { + "resourceId": 1 +} + +
+
+ +   +
+
+

Update a Deposit Product

+
+
+ PUT https://Domain Name/api/v1/depositproducts/{depositId} + POST depositproducts/1 +Content-Type: application/json +Request Body: +{ + "locale": "en", + "description": "Update desc" +} + + { + "resourceId": 1 +} + +
+
+ +   +
+
+

Delete a Deposit Product

+

Deletes a Deposit Product.

+
+
+ +DELETE https://Domain Name/api/v1/savingproducts/{productId} + + +DELETE savingproducts/1 +Content-Type: application/json + + { "resourceId": 1 } +
+
+ + + +   +
+
+

Saving Products :

+

A Saving product is a template that is used when creating a Saving Account. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Field Descriptions
digitsAfterDecimal
Override the currency default value for digitsAfterDecimal.
savingsDepositAmount :
The deposit amount need to be deposited every depositEvery period.
minimumBalanceForWithdrawal :
The minimumbal that is need to be maintained in saving account
depositEvery:
The time period to deposit the amount to saving account every "depositEvery" "frequency"
+ e.g. Every 1 Month
tenureType
This denotes the tenureType for savings account
tenure
The duration for fixed deposit (in months).
+ e.g. 12 +
interestRate
Default interest rate for Saving account
+ e.g. 12
interestType
Denotes the interestType for Saving account
+ simple/compounding
minInterestRate
Minimum supported interest rate for Saving account
+ e.g. 8
maxInterestRate
Maximum supported interest rate for Saving account
+ e.g. 14
isPartialDepositAllowed
Allows to deposit the partial amount for saving account.
+ Used like: isPartialDepositAllowed:true
isLockinPeriodAllowed
This will allow to set the lock-in period for a saving account
+ If 'true' :isLockinPeriodAllowed otherwise isLockinPeriod not allowed
lockinPeriod
Defines a lock-in period for saving account.
savingProductType
Defines the savingProductType for saving account.
+ Recurring/Regular
interestCalculationMethod
Defines the interestCalculationMethod for saving account.
+ Montly Collection/Average Balance etc
+
+
+ +   +
+
+

List SavingProducts

+

Example Requests:

+
savingproducts
+

+
savingproducts?fields=name, ......
+
+
+ GET https://Domain Name/api/v1/savingproducts + +[{ + "id": 1, + "name": "Test", + "currency": { + "code": "USD", + "name": "US Dollar", + "decimalPlaces": 2, + "displaySymbol": "$", + "nameCode": "currency.USD", + "displayLabel": "US Dollar ($)" + }, + "digitsAfterDecimal": 2, + "interestRate": 12.000000, + "minInterestRate": 6.000000, + "maxInterestRate": 12.000000, + "savingsDepositAmount": 1000.000000, + "savingProductType": { + "id": 1, + "code": "savings.product.savingProductType.reccuring", + "value": "Recurring" + }, + "tenureType": { + "id": 1, + "code": "savings.tenure.tenureTypeEnum.fixedPeriod", + "value": "FixedPeriod" + }, + "tenure": 12, + "savingFrequencyType": { + "id": 2, + "code": "saving.product.frequency.period.savingFrequencyType.monthly", + "value": "Months" + }, + "interestType": { + "id": 2, + "code": "savings.interest.type.savingsInterestType.compounding", + "value": "Compounding" + }, + "interestCalculationMethod": { + "id": 1, + "code": "savings.interestCalculation.method.savinginterest.calculation.method.averagebal", + "value": "AverageBalance" + }, + "minimumBalanceForWithdrawal": 100.000000, + "isPartialDepositAllowed": false, + "isLockinPeriodAllowed": false, + "lockinPeriod": 0, + "lockinPeriodType": { + "id": 2, + "code": "deposit.interest.compounding.period.periodFrequencyType.months", + "value": "Months" + }, + "createdOn": 1360594232000, + "lastModifedOn": 1360594232000, + "depositEvery": 3 +}] + +
+
+ +   +
+
+

Retrieve SavingProduct Details Template

+

This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of: +

+

+

Example Request:

+
savingproducts/template
+
+
+ GET https://Domain Name/api/v1/savingproducts/template + +{ + "currency": { + "code": "USD", + "name": "US Dollar", + "decimalPlaces": 2, + "displaySymbol": "$", + "nameCode": "currency.USD", + "displayLabel": "US Dollar ($)" + }, + "digitsAfterDecimal": 2, + "interestRate": 0, + "savingsDepositAmount": 0, + "savingProductType": { + "id": 1, + "code": "savings.product.savingProductType.reccuring", + "value": "Recurring" + }, + "tenureType": { + "id": 1, + "code": "savings.tenure.tenureTypeEnum.fixedPeriod", + "value": "FixedPeriod" + }, + "tenure": 12, + "savingFrequencyType": { + "id": 2, + "code": "saving.product.frequency.period.savingFrequencyType.monthly", + "value": "Months" + }, + "interestType": { + "id": 2, + "code": "savings.interest.type.savingsInterestType.compounding", + "value": "Compounding" + }, + "interestCalculationMethod": { + "id": 1, + "code": "savings.interestCalculation.method.savinginterest.calculation.method.averagebal", + "value": "AverageBalance" + }, + "minimumBalanceForWithdrawal": 100, + "isPartialDepositAllowed": false, + "isLockinPeriodAllowed": false, + "lockinPeriod": 0, + "lockinPeriodType": { + "id": 2, + "code": "savings.product.lockin.period.type.months", + "value": "Months" + }, + "createdOn": 1360596667364, + "lastModifedOn": 1360596667364, + "depositEvery": 3, + "currencyOptions": [{ + "code": "USD", + "name": "US Dollar", + "decimalPlaces": 2, + "displaySymbol": "$", + "nameCode": "currency.USD", + "displayLabel": "US Dollar ($)" + }], + "savingsProductTypeOptions": [{ + "id": 1, + "code": "savings.product.savingProductType.reccuring", + "value": "Recurring" + }, + { + "id": 2, + "code": "savings.product.savingProductType.regular", + "value": "Regular" + }], + "tenureTypeOptions": [{ + "id": 1, + "code": "savings.tenure.tenureTypeEnum.fixedPeriod", + "value": "FixedPeriod" + }, + { + "id": 2, + "code": "savings.tenure.tenureTypeEnum.perpetual", + "value": "Perpetual" + }], + "savingFrequencyOptions": [{ + "id": 2, + "code": "saving.product.frequency.period.savingFrequencyType.monthly", + "value": "Months" + }], + "savingsInterestTypeOptions": [{ + "id": 1, + "code": "savings.interest.type.savingsInterestType.simple", + "value": "Simple" + }, + { + "id": 2, + "code": "savings.interest.type.savingsInterestType.compounding", + "value": "Compounding" + }], + "lockinPeriodTypeOptions": [{ + "id": 2, + "code": "savings.product.lockin.period.type.months", + "value": "Months" + }], + "interestCalculationOptions": [{ + "id": 1, + "code": "savings.interestCalculation.method.savinginterest.calculation.method.averagebal", + "value": "AverageBalance" + }, + { + "id": 2, + "code": "savings.interestCalculation.method.savinginterest.calculation.method.minbal", + "value": "Minimumbalance" + }, + { + "id": 3, + "code": "savings.interestCalculation.method.savinginterest.calculation.method.monthlycllection", + "value": "MonthlyCollection" + }] +} + +
+
+ +   +
+
+

Retrieve a Saving Product

+

Example Requests:

+
savingproducts/1
+

+
savingproducts/1?template=true
+

+
savingproducts/1?fields=name,description
+
+
+ GET https://Domain Name/api/v1/savingproducts/1 + +{ + "id": 1, + "name": "Test", + "currency": { + "code": "USD", + "name": "US Dollar", + "decimalPlaces": 2, + "displaySymbol": "$", + "nameCode": "currency.USD", + "displayLabel": "US Dollar ($)" + }, + "digitsAfterDecimal": 2, + "interestRate": 12, + "minInterestRate": 6, + "maxInterestRate": 12, + "savingsDepositAmount": 1000, + "savingProductType": { + "id": 1, + "code": "savings.product.savingProductType.reccuring", + "value": "Recurring" + }, + "tenureType": { + "id": 1, + "code": "savings.tenure.tenureTypeEnum.fixedPeriod", + "value": "FixedPeriod" + }, + "tenure": 12, + "savingFrequencyType": { + "id": 2, + "code": "saving.product.frequency.period.savingFrequencyType.monthly", + "value": "Months" + }, + "interestType": { + "id": 2, + "code": "savings.interest.type.savingsInterestType.compounding", + "value": "Compounding" + }, + "interestCalculationMethod": { + "id": 1, + "code": "savings.interestCalculation.method.savinginterest.calculation.method.averagebal", + "value": "AverageBalance" + }, + "minimumBalanceForWithdrawal": 100, + "isPartialDepositAllowed": false, + "isLockinPeriodAllowed": false, + "lockinPeriod": 0, + "lockinPeriodType": { + "id": 2, + "code": "deposit.interest.compounding.period.periodFrequencyType.months", + "value": "Months" + }, + "createdOn": 1360594232000, + "lastModifedOn": 1360594232000, + "depositEvery": 3 +} + + + GET https://Domain Name/api/v1/depositproducts/1?template=true + +{ + "id": 1, + "name": "Test", + "currency": { + "code": "USD", + "name": "US Dollar", + "decimalPlaces": 2, + "displaySymbol": "$", + "nameCode": "currency.USD", + "displayLabel": "US Dollar ($)" + }, + "digitsAfterDecimal": 2, + "interestRate": 12, + "minInterestRate": 6, + "maxInterestRate": 12, + "savingsDepositAmount": 1000, + "savingProductType": { + "id": 1, + "code": "savings.product.savingProductType.reccuring", + "value": "Recurring" + }, + "tenureType": { + "id": 1, + "code": "savings.tenure.tenureTypeEnum.fixedPeriod", + "value": "FixedPeriod" + }, + "tenure": 12, + "savingFrequencyType": { + "id": 2, + "code": "saving.product.frequency.period.savingFrequencyType.monthly", + "value": "Months" + }, + "interestType": { + "id": 2, + "code": "savings.interest.type.savingsInterestType.compounding", + "value": "Compounding" + }, + "interestCalculationMethod": { + "id": 1, + "code": "savings.interestCalculation.method.savinginterest.calculation.method.averagebal", + "value": "AverageBalance" + }, + "minimumBalanceForWithdrawal": 100, + "isPartialDepositAllowed": false, + "isLockinPeriodAllowed": false, + "lockinPeriod": 0, + "lockinPeriodType": { + "id": 2, + "code": "deposit.interest.compounding.period.periodFrequencyType.months", + "value": "Months" + }, + "createdOn": 1360594232000, + "lastModifedOn": 1360594232000, + "depositEvery": 3, + "currencyOptions": [ + { + "code": "USD", + "name": "US Dollar", + "decimalPlaces": 2, + "displaySymbol": "$", + "nameCode": "currency.USD", + "displayLabel": "US Dollar ($)" + } + ], + "savingsProductTypeOptions": [ + { + "id": 1, + "code": "savings.product.savingProductType.reccuring", + "value": "Recurring" + }, + { + "id": 2, + "code": "savings.product.savingProductType.regular", + "value": "Regular" + } + ], + "tenureTypeOptions": [ + { + "id": 1, + "code": "savings.tenure.tenureTypeEnum.fixedPeriod", + "value": "FixedPeriod" + }, + { + "id": 2, + "code": "savings.tenure.tenureTypeEnum.perpetual", + "value": "Perpetual" + } + ], + "savingFrequencyOptions": [ + { + "id": 2, + "code": "saving.product.frequency.period.savingFrequencyType.monthly", + "value": "Months" + } + ], + "savingsInterestTypeOptions": [ + { + "id": 1, + "code": "savings.interest.type.savingsInterestType.simple", + "value": "Simple" + }, + { + "id": 2, + "code": "savings.interest.type.savingsInterestType.compounding", + "value": "Compounding" + } + ], + "lockinPeriodTypeOptions": [ + { + "id": 2, + "code": "savings.product.lockin.period.type.months", + "value": "Months" + } + ], + "interestCalculationOptions": [ + { + "id": 1, + "code": "savings.interestCalculation.method.savinginterest.calculation.method.averagebal", + "value": "AverageBalance" + }, + { + "id": 2, + "code": "savings.interestCalculation.method.savinginterest.calculation.method.minbal", + "value": "Minimumbalance" + }, + { + "id": 3, + "code": "savings.interestCalculation.method.savinginterest.calculation.method.monthlycllection", + "value": "MonthlyCollection" + } + ] +} + +
+
+ +   +
+
+

Create a Saving Product

+ + + + + +
Mandatory Fields
name, currencyCode, digitsAfterDecimal,interestPostedEvery, minimumBalance, +
+ tenureInMonths, maturityDefaultInterestRate,maturityMinInterestRate, +
+ maturityMaxInterestRate,interestCompoundedEvery,preClosureInterestRate. +
+
+
+ POST https://Domain Name/api/v1/savingproducts + POST savingproducts +Content-Type: application/json +Request Body: +{ + "locale": "en", + "interestCalculationMethod": "1", + "name": "Test", + "savingProductType": "1", + "description": "", + "currencyCode": "USD", + "digitsAfterDecimal": "2", + "savingsDepositAmount": "1000", + "minimumBalanceForWithdrawal": "100", + "tenure": "12", + "tenureType": "1", + "isLockinPeriodAllowed": "false", + "isPartialDepositAllowed": "false", + "interestRate": "12", + "interestType": "2", + "minInterestRate": "6", + "maxInterestRate": "12", + "depositEvery": "3", + "frequency": "2", + "lockinPeriod": "0", + "lockinPeriodType": "2" +} + + { + "resourceId": 1 +} + +
+
+ +   +
+
+

Update a Saving Product

+
+
+ PUT https://Domain Name/api/v1/savingproducts/{depositId} + POST savingproducts/1 +Content-Type: application/json +Request Body: +{ + "locale": "en", + "description": "Update desc" +} + + { + "resourceId": 1 +} + +
+
+ +   +
+
+

Delete a Saving Product

+

Deletes a Saving Product.

+
+
+ +DELETE https://Domain Name/api/v1/savingproducts/{productId} + + +DELETE savingproducts/1 +Content-Type: application/json + + { "resourceId": 1 } +
+
+ +  
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/GoogleGsonPortfolioApiJsonSerializerService.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/GoogleGsonPortfolioApiJsonSerializerService.java index 99df375a1..61e9f4a84 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/GoogleGsonPortfolioApiJsonSerializerService.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccount/GoogleGsonPortfolioApiJsonSerializerService.java @@ -35,7 +35,7 @@ public class GoogleGsonPortfolioApiJsonSerializerService implements PortfolioApi "currencyCode", "digitsAfterDecimal", "minimumBalance", "maximumBalance", "tenureInMonths", "maturityDefaultInterestRate", "maturityMinInterestRate", "maturityMaxInterestRate", "interestCompoundedEvery", "interestCompoundedEveryPeriodType", "renewalAllowed", "preClosureAllowed", "preClosureInterestRate", "interestCompoundingAllowed", "isLockinPeriodAllowed", - "lockinPeriod", "lockinPeriodType")); + "lockinPeriod", "lockinPeriodType", "currency")); private static final Set SAVINGS_DEPOSIT_ACCOUNT_DATA_PARAMETERS = new HashSet(Arrays.asList("productOptions", "interestCompoundedEveryPeriodTypeOptions", "id", "externalId", "clientId", "clientName", "productId", "productName", "status", diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/service/SavingProductCommandValidator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/service/SavingProductCommandValidator.java index 290427dc8..5305a10b6 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/service/SavingProductCommandValidator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsaccountproduct/service/SavingProductCommandValidator.java @@ -45,10 +45,8 @@ public class SavingProductCommandValidator { baseDataValidator.reset().parameter("interestCalculationMethod").value(command.getInterestCalculationMethod()).ignoreIfNull(); baseDataValidator.reset().parameter("minimumBalanceForWithdrawal").value(command.getMinimumBalanceForWithdrawal()).ignoreIfNull() .zeroOrPositiveAmount(); - baseDataValidator.reset().parameter("isPartialDepositAllowed").value(command.isPartialDepositAllowed()) - .trueOrFalseRequired(command.isPartialDepositAllowedChanged()).ignoreIfNull(); - baseDataValidator.reset().parameter("isLockinPeriodAllowed").value(command.isLockinPeriodAllowed()) - .trueOrFalseRequired(command.isLockinPeriodAllowedChanged()).ignoreIfNull(); + baseDataValidator.reset().parameter("isPartialDepositAllowed").value(command.isPartialDepositAllowed()).ignoreIfNull(); + baseDataValidator.reset().parameter("isLockinPeriodAllowed").value(command.isLockinPeriodAllowed()).ignoreIfNull(); baseDataValidator.reset().parameter("lockinPeriod").value(command.getLockinPeriod()).ignoreIfNull(); baseDataValidator.reset().parameter("lockinPeriodType").value(command.getLockinPeriodType()).ignoreIfNull(); diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositaccount/data/DepositAccountData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositaccount/data/DepositAccountData.java index 34406f9dc..dd8f53936 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositaccount/data/DepositAccountData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositaccount/data/DepositAccountData.java @@ -110,7 +110,7 @@ public class DepositAccountData { this.preClosureInterestRate = null; this.interestCompoundedEveryPeriodTypeOptions = new ArrayList(); - this.productOptions = new ArrayList(); + this.productOptions = null; this.withdrawnonDate = null; this.closedonDate = null; @@ -121,17 +121,17 @@ public class DepositAccountData { this.interestPaid = null; this.isInterestWithdrawable = false; - this.interestCompoundingAllowed = true; - this.availableInterestForWithdrawal = new BigDecimal(0); - this.availableWithdrawalAmount = new BigDecimal(0); - this.todaysDate = new LocalDate(); + this.interestCompoundingAllowed = false; + this.availableInterestForWithdrawal = null; + this.availableWithdrawalAmount = null; + this.todaysDate = null; - this.isLockinPeriodAllowed = true; + this.isLockinPeriodAllowed = false; this.lockinPeriod = null; this.lockinPeriodType = null; - this.availableInterest = BigDecimal.ZERO; - this.interestPostedAmount = BigDecimal.ZERO; + this.availableInterest = null; + this.interestPostedAmount = null; this.lastInterestPostedDate = null; this.nextInterestPostedDate = null; @@ -169,7 +169,7 @@ public class DepositAccountData { this.preClosureInterestRate = account.getPreClosureInterestRate(); this.interestCompoundedEveryPeriodTypeOptions = interestCompoundedEveryPeriodTypeOptions; - this.productOptions = new ArrayList(productOptions); + this.productOptions = defaultIfEmpty(productOptions); this.withdrawnonDate = account.getWithdrawnonDate(); this.rejectedonDate = account.getRejectedonDate(); @@ -326,7 +326,8 @@ public class DepositAccountData { public DepositAccountData(final Long clientId, final String clientName, final Long productId, final String productName, final CurrencyData currency, final BigDecimal deposit, final BigDecimal interestRate, final Integer tenureInMonths, final Integer interestCompoundedEvery, final EnumOptionData interestCompoundedEveryPeriodType, final boolean renewalAllowed, - final boolean preClosureAllowed, final BigDecimal preClosureInterestRate, final boolean interestCompoundingAllowed) { + final boolean preClosureAllowed, final BigDecimal preClosureInterestRate, final boolean interestCompoundingAllowed, Integer lockinPeriod, + EnumOptionData lockinPeriodType, boolean lockinPeriodAllowed) { this.id = null; this.externalId = null; this.status = null; @@ -365,12 +366,11 @@ public class DepositAccountData { this.interestCompoundingAllowed = interestCompoundingAllowed; this.availableInterestForWithdrawal = BigDecimal.ZERO; this.availableWithdrawalAmount = BigDecimal.ZERO; - this.todaysDate = new LocalDate(); + this.todaysDate = null; - // need to update in constructor's call method and update it - this.lockinPeriod = Integer.valueOf(0); - this.isLockinPeriodAllowed = true; - this.lockinPeriodType = interestCompoundedEveryPeriodType; + this.lockinPeriod = lockinPeriod; + this.isLockinPeriodAllowed = lockinPeriodAllowed; + this.lockinPeriodType = lockinPeriodType; this.availableInterest = BigDecimal.ZERO; this.interestPostedAmount = BigDecimal.ZERO; @@ -593,14 +593,14 @@ public class DepositAccountData { return BigDecimal.ZERO; } } else - return BigDecimal.ZERO; + return null; return availableInterestForWithdrawal; } private BigDecimal determineAvalableWithdrawalAmount(final DepositAccountData account) { - BigDecimal avalablePreclosureWithdrawalAmount = BigDecimal.ZERO; + BigDecimal avalablePreclosureWithdrawalAmount = null; if (this.status != null) { if (account.getStatus().getId() == 300) { // if(new LocalDate().isBefore(account.getMaturedOn()) || new @@ -633,5 +633,13 @@ public class DepositAccountData { return BigDecimal.valueOf(depsoitAmount.doubleValue() * days.doubleValue() * interestRateForOneDay.doubleValue()); } + + private List defaultIfEmpty(final Collection collection) { + List returnCollection = null; + if (collection != null && !collection.isEmpty()) { + returnCollection = new ArrayList(collection); + } + return returnCollection; + } } \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositaccount/service/DepositAccountReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositaccount/service/DepositAccountReadPlatformServiceImpl.java index 0eb1378e2..e1817beb5 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositaccount/service/DepositAccountReadPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savingsdepositaccount/service/DepositAccountReadPlatformServiceImpl.java @@ -110,7 +110,7 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead selectedProduct.getMaturityDefaultInterestRate(), selectedProduct.getTenureInMonths(), selectedProduct.getInterestCompoundedEvery(), selectedProduct.getInterestCompoundedEveryPeriodType(), selectedProduct.isRenewalAllowed(), selectedProduct.isPreClosureAllowed(), selectedProduct.getPreClosureInterestRate(), - selectedProduct.isInterestCompoundingAllowed()); + selectedProduct.isInterestCompoundingAllowed(),selectedProduct.getLockinPeriod(),selectedProduct.getLockinPeriodType(),selectedProduct.isLockinPeriodAllowed()); } else { accountData = DepositAccountData.createFrom(clientAccount.id(), clientAccount.displayName()); } 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 8ffbacd9c..10d474c9b 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 @@ -107,7 +107,7 @@ public class DepositProductsApiResource { "lastModifedOn", "currencyCode", "digitsAfterDecimal", "minimumBalance", "maximumBalance", "tenureInMonths", "maturityDefaultInterestRate", "maturityMinInterestRate", "maturityMaxInterestRate", "interestCompoundedEvery", "interestCompoundedEveryPeriodType", "renewalAllowed", "preClosureAllowed", "preClosureInterestRate", - "interestCompoundingAllowed", "isLockinPeriodAllowed", "lockinPeriod", "lockinPeriodType")); + "interestCompoundingAllowed", "isLockinPeriodAllowed", "lockinPeriod", "lockinPeriodType", "currency")); Set responseParameters = ApiParameterHelper.extractFieldsForResponseIfProvided(uriInfo.getQueryParameters()); if (responseParameters.isEmpty()) { @@ -131,7 +131,7 @@ public class DepositProductsApiResource { "lastModifedOn", "currencyCode", "digitsAfterDecimal", "minimumBalance", "maximumBalance", "tenureInMonths", "maturityDefaultInterestRate", "maturityMinInterestRate", "maturityMaxInterestRate", "interestCompoundedEvery", "interestCompoundedEveryPeriodType", "renewalAllowed", "preClosureAllowed", "preClosureInterestRate", - "interestCompoundingAllowed", "isLockinPeriodAllowed", "lockinPeriod", "lockinPeriodType")); + "interestCompoundingAllowed", "isLockinPeriodAllowed", "lockinPeriod", "lockinPeriodType", "currency")); Set responseParameters = ApiParameterHelper.extractFieldsForResponseIfProvided(uriInfo.getQueryParameters()); if (responseParameters.isEmpty()) { @@ -162,7 +162,7 @@ public class DepositProductsApiResource { "currencyCode", "digitsAfterDecimal", "minimumBalance", "maximumBalance", "tenureInMonths", "maturityDefaultInterestRate", "maturityMinInterestRate", "maturityMaxInterestRate", "interestCompoundedEvery", "interestCompoundedEveryPeriodType", "renewalAllowed", "preClosureAllowed", "preClosureInterestRate", "isLockinPeriodAllowed", "lockinPeriod", - "lockinPeriodType")); + "lockinPeriodType", "currency")); Set responseParameters = ApiParameterHelper.extractFieldsForResponseIfProvided(uriInfo.getQueryParameters()); if (responseParameters.isEmpty()) { 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 f0b43e783..6104386f4 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 @@ -28,6 +28,7 @@ public class DepositProductData { private final BigDecimal maturityMaxInterestRate; private final Integer interestCompoundedEvery; private final EnumOptionData interestCompoundedEveryPeriodType; + private final CurrencyData currency; private final boolean renewalAllowed; private final boolean preClosureAllowed; @@ -51,7 +52,7 @@ public class DepositProductData { final BigDecimal maturityMaxInterestRate, 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 Integer lockinPeriod, final EnumOptionData lockinPeriodType,final CurrencyData currencyData) { this.createdOn = createdOn; this.lastModifedOn = lastModifedOn; @@ -78,7 +79,7 @@ public class DepositProductData { this.lockinPeriod = lockinPeriod; this.lockinPeriodType = lockinPeriodType; this.isLockinPeriodAllowed = isLockinPeriodAllowed; - + this.currency = currencyData; this.currencyOptions = new ArrayList(); this.interestCompoundedEveryPeriodTypeOptions = new ArrayList(); } @@ -93,25 +94,27 @@ public class DepositProductData { this.name = null; this.description = null; this.currencyCode = null; - this.digitsAfterDecimal = Integer.valueOf(0); - this.minimumBalance = BigDecimal.ZERO; - this.maximumBalance = BigDecimal.ZERO; + this.digitsAfterDecimal = null; + this.minimumBalance = null; + this.maximumBalance = null; - this.tenureInMonths = Integer.valueOf(0); - this.maturityDefaultInterestRate = BigDecimal.ZERO; - this.maturityMinInterestRate = BigDecimal.ZERO; - this.maturityMaxInterestRate = BigDecimal.ZERO; - this.interestCompoundedEvery = Integer.valueOf(1); + this.tenureInMonths = null; + this.maturityDefaultInterestRate = null; + this.maturityMinInterestRate = null; + this.maturityMaxInterestRate = null; + this.interestCompoundedEvery = null; this.interestCompoundedEveryPeriodType = defaultInterestCompoundedEveryPeriodType; - this.renewalAllowed = true; - this.preClosureAllowed = true; - this.preClosureInterestRate = BigDecimal.ZERO; - this.interestCompoundingAllowed = true; + this.renewalAllowed = false; + this.preClosureAllowed = false; + this.preClosureInterestRate = null; + this.interestCompoundingAllowed = false; - this.isLockinPeriodAllowed = true; - this.lockinPeriod = Integer.valueOf(0); + this.isLockinPeriodAllowed = false; + this.lockinPeriod = null; this.lockinPeriodType = defaultInterestCompoundedEveryPeriodType; + + this.currency = null; this.currencyOptions = currencyOptions; this.interestCompoundedEveryPeriodTypeOptions = interestCompoundedEveryPeriodTypeOptions; @@ -145,9 +148,15 @@ public class DepositProductData { this.lockinPeriod = product.getLockinPeriod(); this.lockinPeriodType = product.getLockinPeriodType(); this.isLockinPeriodAllowed = product.isLockinPeriodAllowed(); - + this.currencyOptions = currencyOptions; this.interestCompoundedEveryPeriodTypeOptions = interestCompoundedEveryPeriodTypeOptions; + + if (this.currencyOptions != null && this.currencyOptions.size() == 1) { + this.currency = new ArrayList(this.currencyOptions).get(0); + } else { + this.currency = product.currency; + } } public Long getId() { 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 fea8c915d..cac67af38 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 @@ -321,7 +321,7 @@ public class DepositProduct extends AbstractAuditableCustom { if (!inRange) { final String actualValue = depositAmount.toPlainString(); final String minValue = (this.minimumBalance == null) ? "" : this.minimumBalance.toPlainString(); - final String maxValue = (this.minimumBalance == null) ? "" : this.minimumBalance.toPlainString(); + final String maxValue = (this.maximumBalance == null) ? "" : this.maximumBalance.toPlainString(); throw new DepositProductValueOutsideRangeException(actualValue, minValue, maxValue, "deposit.account.deposit.amount"); } } 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 82142bd2b..e75220dbd 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 @@ -90,6 +90,10 @@ public class DepositProductReadPlatformServiceImpl implements DepositProductRead String currencyCode = rs.getString("currencyCode"); Integer currencyDigits = JdbcSupport.getInteger(rs, "currencyDigits"); + String currencyName = rs.getString("currencyName"); + String currencyNameCode = rs.getString("currencyNameCode"); + String currencyDisplaySymbol = rs.getString("currencyDisplaySymbol"); + CurrencyData currencyData = new CurrencyData(currencyCode, currencyName, currencyDigits, currencyDisplaySymbol, currencyNameCode); DateTime createdOn = JdbcSupport.getDateTime(rs, "createdon"); DateTime lastModifedOn = JdbcSupport.getDateTime(rs, "modifiedon"); @@ -121,7 +125,7 @@ public class DepositProductReadPlatformServiceImpl implements DepositProductRead return new DepositProductData(createdOn, lastModifedOn, id, exernalId, name, description, currencyCode, currencyDigits, minimumBalance, maximumBalance, tenureMonths, maturityDefaultInterestRate, maturityMinInterestRate, maturityMaxInterestRate, interestCompoundedEvery, interestCompoundedEveryPeriodType, canRenew, canPreClose, - preClosureInterestRate, interestCompoundingAllowed, isLockinPeriodAllowed, lockinPeriod, lockinPeriodType); + preClosureInterestRate, interestCompoundingAllowed, isLockinPeriodAllowed, lockinPeriod, lockinPeriodType, currencyData); } }