update loan product api request response examples.

This commit is contained in:
Keith Woodlock
2012-05-21 21:55:44 +01:00
parent cad2722d96
commit de5b1209ae
2 changed files with 50 additions and 305 deletions
+50 -287
View File
@@ -411,10 +411,8 @@
</tbody></table> </tbody></table>
</div> </div>
</div> </div>
<!-- start of offices content -->
<a id="offices" name="offices" class="old-syle-anchor">&nbsp;</a> <a id="offices" name="offices" class="old-syle-anchor">&nbsp;</a>
<div class="method-section"> <div class="method-section">
<div class="method-description"> <div class="method-description">
@@ -424,22 +422,7 @@
All subsequent offices added must have a parent office.</p> All subsequent offices added must have a parent office.</p>
</div> </div>
</div> </div>
<!--
<div class="method-section">
<div class="method-description">
<h5>Attributes</h5>
<dl class="argument-list">
<dt>id</dt><dd>long <span>platform identifier of the office.</span></dd>
<dt>name</dt><dd>string <span>name of the office.</span></dd>
<dt>name</dt>
<dd>blah <span></span></dd>
<dd>blah</dd>
<dt>card</dt>
</dl>
</div>
</div>
-->
<a id="offices_list" name="offices_list" class="old-syle-anchor">&nbsp;</a> <a id="offices_list" name="offices_list" class="old-syle-anchor">&nbsp;</a>
<div class="method-section"> <div class="method-section">
<div class="method-description"> <div class="method-description">
@@ -652,159 +635,8 @@ Request Body:
</div> </div>
<!-- end of office api docs --> <!-- end of office api docs -->
<a id="loanproducts_retrieve" name="loanproducts_retrieve" class="old-syle-anchor">&nbsp;</a> <!-- start of loan products api docs -->
<div class="method-section">
<div class="method-description">
<h4>Retrieve a Loan Product</h4>
<p>Returns loan product fields. It also returns allowed value lists which help build a maintenance User Interface.
JPW - includes validation values (might be ok or option), enum?
</p>
<p>Example Request:
<a style="word-wrap: break-word;" href="http://localhost:8080/mifosng-provider/api/v1/loanproducts/1">http://localhost:8080/mifosng-provider/api/v1/loanproducts/1</a>
</p>
</div>
<div class="method-example">
<code class="method-declaration">GET https://thedomainname/api/v1/loanproducts/{productId}</code>
<code class="method-response"> {
"id": 1,
"name": "Agricultural Loan",
"description": "An agricultural loan given to farmers to help buy crop, stock and machinery. With an arrears tolerance setting of 1,000 CFA, loans are not marked as 'in arrears' or 'in bad standing' if the amount outstanding is less than this. Interest rate is described using monthly percentage rate (MPR) even though the loan typically lasts a year and requires one repayment (typically at time when farmer sells crop)",
"principalMoney": {
"currencyCode": "XOF",
"currencyDigitsAfterDecimal": 0,
"amount": 100000,
"defaultName": "CFA Franc BCEAO",
"nameCode": "currency.XOF",
"displaySymbol": "CFA",
"zero": false,
"greaterThanZero": true,
"displaySymbolValue": "100000 CFA"
},
"interestRatePerPeriod": 1.75,
"interestRatePeriod": 2,
"annualInterestRate": 21,
"interestMethod": 0,
"interestRateCalculatedInPeriod": 0,
"numberOfInterestFreePeriods": 0,
"repaidEvery": 12,
"repaymentPeriodFrequency": 2,
"numberOfRepayments": 1,
"amortizationMethod": 1,
"inArrearsTolerance": {
"currencyCode": "XOF",
"currencyDigitsAfterDecimal": 0,
"amount": 1000,
"defaultName": "CFA Franc BCEAO",
"nameCode": "currency.XOF",
"displaySymbol": "CFA",
"zero": false,
"greaterThanZero": true,
"displaySymbolValue": "1000 CFA"
},
"createdOn": "2012-04-12T00:00:00.000+10:00",
"lastModifedOn": "2012-04-12T00:00:00.000+10:00",
"possibleCurrencies": [
{
"code": "XOF",
"name": "CFA Franc BCEAO",
"decimalPlaces": 0,
"displaySymbol": "CFA",
"nameCode": "currency.XOF",
"displayLabel": "CFA Franc BCEAO (CFA)"
},
{
"code": "ETB",
"name": "Ethiopian Birr",
"decimalPlaces": 2,
"displaySymbol": null,
"nameCode": "currency.ETB",
"displayLabel": "Ethiopian Birr [ETB]"
}
],
"possibleAmortizationOptions": [
{
"id": 1,
"value": "Equal installments"
},
{
"id": 0,
"value": "Equal principle payments"
}
],
"possibleInterestOptions": [
{
"id": 0,
"value": "Declining Balance"
},
{
"id": 1,
"value": "Flat"
}
],
"possibleInterestRateCalculatedInPeriodOptions": [
{
"id": 0,
"value": "Daily"
},
{
"id": 1,
"value": "Same as repayment period"
}
],
"repaymentFrequencyOptions": [
{
"id": 0,
"value": "Days"
},
{
"id": 1,
"value": "Weeks"
},
{
"id": 2,
"value": "Months"
}
],
"interestFrequencyOptions": [
{
"id": 2,
"value": "Per month"
},
{
"id": 3,
"value": "Per year"
}
],
"interestRebateAllowed": false,
"flexible": false
}
</code>
</div>
</div>
<a id="loanproducts_create" name="loanproducts_create" class="old-syle-anchor">&nbsp;</a>
<div class="method-section">
<div class="method-description">
<h4>Create a Loan Product</h4>
</div>
<div class="method-example">
<code class="method-declaration">POST https://thedomainname/api/v1/loanproducts</code>
<code class="method-request">http://localhost:8080/mifosng-provider/api/v1/loanproducts
Content-Type: application/json
Request Body:
new loan product json here
</code>
</div>
</div>
<a id="loanproducts_update" name="loanproducts_update" class="old-syle-anchor">&nbsp;</a>
<div class="method-section">
<a id="loanproducts" name="loanproducts" class="old-syle-anchor">&nbsp;</a> <a id="loanproducts" name="loanproducts" class="old-syle-anchor">&nbsp;</a>
<div class="method-section"> <div class="method-section">
<div class="method-description"> <div class="method-description">
@@ -813,57 +645,13 @@ Request Body:
</p> </p>
</div> </div>
</div> </div>
<div class="method-section">
<div class="method-description">
<h5>Attributes</h5>
<dl class="argument-list">
<dt>
id
</dt>
<dd>
string <span>jpw ipsum as an example of showing the (at least important) columns</span>
</dd>
<dt>
amount
</dt>
<dd>positive integer or zero <span></span>
</dd>
<dd>Amount charged in cents</dd>
<dt>
card
</dt>
<dd>
<dd><strong>hash</strong></dd>
<dd>
Hash describing the card used to make the charge
<dl class="argument-list">
<dt>
inner object
</dt>
<dd>inner string <span> inner span extra </span>
</dd>
</dl>
</dd>
<dt>
fingerprint
</dt>
<dd>string<span> or something</span>
</dd>
</dl>
</div>
</div>
<a id="loanproducts_list" name="loanproducts_list" class="old-syle-anchor">&nbsp;</a> <a id="loanproducts_list" name="loanproducts_list" class="old-syle-anchor">&nbsp;</a>
<div class="method-section"> <div class="method-section">
<div class="method-description"> <div class="method-description">
<h4>List Loan Products</h4> <h4>List Loan Products</h4>
<p>Example Request: <p>Example Request:
<a style="word-wrap: break-word;" href="http://localhost:8080/mifosng-provider/api/v1/loanproducts">http://localhost:8080/mifosng-provider/api/v1/loanproducts</a> <a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/loanproducts">https://localhost:8443/mifosng-provider/api/v1/loanproducts</a>
</p> </p>
</div> </div>
<div class="method-example"> <div class="method-example">
@@ -916,53 +704,6 @@ Request Body:
"interestFrequencyOptions": [], "interestFrequencyOptions": [],
"interestRebateAllowed": false, "interestRebateAllowed": false,
"flexible": false "flexible": false
},
{
"id": 2,
"name": "curr loan",
"description": "asdff",
"principalMoney": {
"currencyCode": "ETB",
"currencyDigitsAfterDecimal": 2,
"amount": 100000,
"defaultName": "Ethiopian Birr",
"nameCode": "currency.ETB",
"displaySymbol": null,
"zero": false,
"greaterThanZero": true,
"displaySymbolValue": "100000.00 null"
},
"interestRatePerPeriod": 0,
"interestRatePeriod": 2,
"annualInterestRate": 0,
"interestMethod": 0,
"interestRateCalculatedInPeriod": 0,
"numberOfInterestFreePeriods": 0,
"repaidEvery": 1,
"repaymentPeriodFrequency": 2,
"numberOfRepayments": 5,
"amortizationMethod": 1,
"inArrearsTolerance": {
"currencyCode": "ETB",
"currencyDigitsAfterDecimal": 2,
"amount": 0,
"defaultName": "Ethiopian Birr",
"nameCode": "currency.ETB",
"displaySymbol": null,
"zero": true,
"greaterThanZero": false,
"displaySymbolValue": "0.00 null"
},
"createdOn": "2012-04-15T00:00:00.000+10:00",
"lastModifedOn": "2012-04-15T00:00:00.000+10:00",
"possibleCurrencies": [],
"possibleAmortizationOptions": [],
"possibleInterestOptions": [],
"possibleInterestRateCalculatedInPeriodOptions": [],
"repaymentFrequencyOptions": [],
"interestFrequencyOptions": [],
"interestRebateAllowed": false,
"flexible": false
} }
] ]
} }
@@ -970,7 +711,6 @@ Request Body:
</div> </div>
</div> </div>
<a id="loanproducts_template" name="loanproducts_template" class="old-syle-anchor">&nbsp;</a> <a id="loanproducts_template" name="loanproducts_template" class="old-syle-anchor">&nbsp;</a>
<div class="method-section"> <div class="method-section">
<div class="method-description"> <div class="method-description">
@@ -978,7 +718,7 @@ Request Body:
<p>Returns a template that contains the loan product fields and allowed value lists. This helps build a maintenance User Interface. <p>Returns a template that contains the loan product fields and allowed value lists. This helps build a maintenance User Interface.
</p> </p>
<p>Example Request: <p>Example Request:
<a style="word-wrap: break-word;" href="http://localhost:8080/mifosng-provider/api/v1/loanproducts/template">http://localhost:8080/mifosng-provider/api/v1/loanproducts/template</a> <a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/loanproducts/template">https://localhost:8443/mifosng-provider/api/v1/loanproducts/template</a>
</p> </p>
</div> </div>
<div class="method-example"> <div class="method-example">
@@ -1100,7 +840,6 @@ Request Body:
</div> </div>
</div> </div>
<a id="loanproducts_retrieve" name="loanproducts_retrieve" class="old-syle-anchor">&nbsp;</a> <a id="loanproducts_retrieve" name="loanproducts_retrieve" class="old-syle-anchor">&nbsp;</a>
<div class="method-section"> <div class="method-section">
<div class="method-description"> <div class="method-description">
@@ -1109,7 +848,7 @@ Request Body:
JPW - includes validation values (might be ok or option), enum? JPW - includes validation values (might be ok or option), enum?
</p> </p>
<p>Example Request: <p>Example Request:
<a style="word-wrap: break-word;" href="http://localhost:8080/mifosng-provider/api/v1/loanproducts/1">http://localhost:8080/mifosng-provider/api/v1/loanproducts/1</a> <a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/loanproducts/1">https://localhost:8443/mifosng-provider/api/v1/loanproducts/1</a>
</p> </p>
</div> </div>
<div class="method-example"> <div class="method-example">
@@ -1230,8 +969,7 @@ Request Body:
</code> </code>
</div> </div>
</div> </div>
<a id="loanproducts_create" name="loanproducts_create" class="old-syle-anchor">&nbsp;</a> <a id="loanproducts_create" name="loanproducts_create" class="old-syle-anchor">&nbsp;</a>
<div class="method-section"> <div class="method-section">
<div class="method-description"> <div class="method-description">
@@ -1239,17 +977,29 @@ Request Body:
</div> </div>
<div class="method-example"> <div class="method-example">
<code class="method-declaration">POST https://thedomainname/api/v1/loanproducts</code> <code class="method-declaration">POST https://thedomainname/api/v1/loanproducts</code>
<code class="method-request">http://localhost:8080/mifosng-provider/api/v1/loanproducts <code class="method-request">https://localhost:8443/mifosng-provider/api/v1/loanproducts
Content-Type: application/json
Request Body:
Content-Type: application/json {
Request Body: "name": "New kind of Loan",
new loan product json here "description": "A description not exceeding 500 characters.",
</code> "currencyCode": "XOF",
"digitsAfterDecimal": 0,
"principal": 100000,
"inArrearsToleranceAmount": 1000,
"numberOfRepayments": 1,
"repaymentEvery": 1,
"repaymentFrequency": 2,
"amortizationMethod": 1,
"interestRatePerPeriod": 1.75,
"interestRateFrequencyMethod": 2,
"interestCalculationPeriodMethod": 1,
"interestMethod": 0
}
</code>
</div> </div>
</div> </div>
<a id="loanproducts_update" name="loanproducts_update" class="old-syle-anchor">&nbsp;</a> <a id="loanproducts_update" name="loanproducts_update" class="old-syle-anchor">&nbsp;</a>
<div class="method-section"> <div class="method-section">
<div class="method-description"> <div class="method-description">
@@ -1257,16 +1007,29 @@ Request Body:
</div> </div>
<div class="method-example"> <div class="method-example">
<code class="method-declaration">POST https://thedomainname/api/v1/loanproducts/{loanId}</code> <code class="method-declaration">POST https://thedomainname/api/v1/loanproducts/{loanId}</code>
<code class="method-request">http://localhost:8080/mifosng-provider/api/v1/loanproducts/1 <code class="method-request">https://localhost:8443/mifosng-provider/api/v1/loanproducts/1
Content-Type: application/json
Request Body:
Content-Type: application/json {
Request Body: "name": "New kind of Loan updated",
update loan product json here "description": "An updated description not exceeding 500 characters.",
</code> "currencyCode": "XOF",
"digitsAfterDecimal": 0,
"principal": 100000,
"inArrearsToleranceAmount": 1000,
"numberOfRepayments": 1,
"repaymentEvery": 1,
"repaymentFrequency": 2,
"amortizationMethod": 1,
"interestRatePerPeriod": 1.75,
"interestRateFrequencyMethod": 2,
"interestCalculationPeriodMethod": 1,
"interestMethod": 0
}
</code>
</div> </div>
</div> </div>
<!-- end of loan products api docs -->
<a id="additionalfields" name="additionalfields" class="old-syle-anchor">&nbsp;</a> <a id="additionalfields" name="additionalfields" class="old-syle-anchor">&nbsp;</a>
@@ -26,8 +26,6 @@ public class LoanProductCommand {
private Integer amortizationMethod; private Integer amortizationMethod;
private Integer interestMethod; private Integer interestMethod;
private Integer interestCalculationPeriodMethod; private Integer interestCalculationPeriodMethod;
private boolean flexibleRepaymentSchedule = false;
private boolean interestRebateAllowed = false;
protected LoanProductCommand() { protected LoanProductCommand() {
// //
@@ -161,20 +159,4 @@ public class LoanProductCommand {
Integer interestCalculationPeriodMethod) { Integer interestCalculationPeriodMethod) {
this.interestCalculationPeriodMethod = interestCalculationPeriodMethod; this.interestCalculationPeriodMethod = interestCalculationPeriodMethod;
} }
public boolean isFlexibleRepaymentSchedule() {
return flexibleRepaymentSchedule;
}
public void setFlexibleRepaymentSchedule(boolean flexibleRepaymentSchedule) {
this.flexibleRepaymentSchedule = flexibleRepaymentSchedule;
}
public boolean isInterestRebateAllowed() {
return interestRebateAllowed;
}
public void setInterestRebateAllowed(boolean interestRebateAllowed) {
this.interestRebateAllowed = interestRebateAllowed;
}
} }