api docs update

This commit is contained in:
John Woodlock
2012-05-31 16:53:53 +10:00
parent c37041e6b7
commit 445da9a4e0
2 changed files with 81 additions and 27 deletions
+63 -26
View File
@@ -1604,17 +1604,34 @@ No Request Body:
</p>
<h5>Arguments</h5>
<dl class="argument-list">
<dt>type</dt>
<dd>String<span> Optional, case-insensitive</span></dd>
<dd>The default action is to return details for Repayment of a loan. If the value is 'waiver' then details relevant to Waiving a loan amount are returned.</dd>
<dt>command</dt>
<dd>String<span> mandatory, case-insensitive</span></dd>
<dd><b>'repayment'</b><br>
"date" is set to the date of the first outstanding installment.<br>
"total" "amount" is set to the amount outstanding.</dd>
<dd><b>'waiver'</b><br>
"date" is set to the current date.<br>
"total" "amount" is set to the remaining loan principal outstanding.</dd>
</dl>
<p>Example Request:
<a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/loans/1/transactions/template?type=waiver">https://localhost:8443/mifosng-provider/api/v1/loans/1/transactions/template?type=waiver"</a>
</p>
<p>Example Request: </p>
<a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/loans/10/transactions/template?command=repayment&pretty=true">https://localhost:8443/mifosng-provider/api/v1/loans/10/transactions/template?command=repayment&pretty=true</a>
</div>
<div class="method-example">
<code class="method-declaration">GET https://thedomainname/api/v1/loans/{loanId}/transactions/template"</code>
<code class="method-response"> to be done
<code class="method-response">{
"date" : [ 2009, 8, 1 ],
"total" : {
"currencyCode" : "XOF",
"digitsAfterDecimal" : 0,
"amount" : 471,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "471 CFA"
}
}
</code>
</div>
</div>
@@ -1623,22 +1640,27 @@ No Request Body:
<div class="method-description">
<h4>Make a Repayment / Loan Waiver</h4>
<dl class="argument-list">
<dt>type</dt>
<dt>command</dt>
<dd>String<span> Optional, case-insensitive</span></dd>
<dd>The default action is to make a Loan Repayment. If the value is 'waiver' then a Loan Waiver is made.</dd>
<dd>'repayment' : Make Loan Repayment.</dd>
<dd>'waiver' : Loan Waiver.</dd>
</dl>
</div>
<div class="method-example">
<code class="method-declaration">POST https://thedomainname/api/v1/loans/{loanId}/transactions</code>
<code class="method-request">https://localhost:8443/mifosng-provider/api/v1/loans/1/transactions
Content-Type: application/json
Request Body:
new json here
<code class="method-request">POST https://localhost:8443/mifosng-provider/api/v1/loans/37/transactions?command=repayment
Content-Type: application/json
Request Body:
{
"locale": "en_GB",
"dateFormat": "dd MMMM yyyy",
"transactionDate": "14 May 2012",
"transactionAmount": "559.88",
"note": "Repayment at branch"
}
</code>
<code class="method-response">{
"entityId": 2
"entityId": 37
}
</code>
</div>
@@ -1648,13 +1670,31 @@ No Request Body:
<div class="method-section">
<div class="method-description">
<h4>Retrieve a Repayment or Waiver Details</h4>
<p>Example Request:
<a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/loans/1/transactions/1">https://localhost:8443/mifosng-provider/api/v1/loans/1/transactions/1</a>
</p>
<p>Example Request: </p>
<a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/loans/10/transactions/20?pretty=true">https://localhost:8443/mifosng-provider/api/v1/loans/10/transactions/20?pretty=true</a>
</div>
<div class="method-example">
<code class="method-declaration">GET https://thedomainname/api/v1/loans/{loanId}/transactions/{transactionId}</code>
<code class="method-response">
<code class="method-response">{
"id" : 10,
"date" : [ 2009, 1, 29 ],
"principal" : null,
"interest" : null,
"total" : {
"currencyCode" : "XOF",
"digitsAfterDecimal" : 0,
"amount" : 300000,
"defaultName" : "CFA Franc BCEAO",
"nameCode" : "currency.XOF",
"displaySymbol" : "CFA",
"zero" : false,
"greaterThanZero" : true,
"displaySymbolValue" : "300000 CFA"
},
"totalWaived" : null,
"overpaid" : null,
"transactionOffsetFromToday" : -1218
}
</code>
</div>
</div>
@@ -1664,16 +1704,13 @@ No Request Body:
<h4>Adjust a Repayment or Waiver</h4>
</div>
<div class="method-example">
<code class="method-declaration">PUT https://thedomainname/api/v1/loans/{loanId}/transactions/{transactionId}</code>
<code class="method-request">https://localhost:8443/mifosng-provider/api/v1/loans/1/transactions/1
<code class="method-declaration">POST https://thedomainname/api/v1/loans/{loanId}/transactions/{transactionId}</code>
<code class="method-request">POST https://localhost:8443/mifosng-provider/api/v1/loans/10/transactions/20
Content-Type: application/json
Request Body:
new json here
</code>
<code class="method-response">{
"entityId": 2
"entityId": 10
}
</code>
</div>
+18 -1
View File
@@ -42,7 +42,23 @@ Column 'loan_status_id' cannot be null; SQL [n/a]; constraint [null]; nested exc
somtimes client returns... always loanId OK?
sometimes clientId returned... always loanId OK?
LOAN TRANSACTIONS (repay and waive - and maybe reversal - but not disbursement) general talk needed as retrieve could work for any txn?
transaction type... UNKNOWN(0), DISBURSEMENT(1), REPAYMENT(2), REVERSAL(3), WAIVED(4);
Create - (command has string and proper value fields... so assume its like eventDate above)
If you undo disbursal does it undo the loantransaction? - didnt test
Template - does waiver amount default to 'rest of loan' cos it looked like it missed out on other waivers. didn't test
repayment amount matches current installment outstanding amount w/o taking waivers into account.
check descriptions - couldn't test because of invalid locale
retrieve: display transaction type value?
"principal" : null, "interest" : null, total, "totalWaived" : null, "overpaid" : null, and the offset - are nulls ever put in?
on create and adjust returns clientId can it be transaction id or loanId?
list of loan transactions not available (except in summary presume repayments has repayments and waivers and adjusts)
---------------------------------------------------------
Additional Fields
@@ -57,4 +73,5 @@ Identify Fields that need explaining
Clients
displayName, externalId, maxJoinedOnOffsetFromToday
repayment/waiver