From 445da9a4e08e4893f1b6f2dbc59bc6fa34641eac Mon Sep 17 00:00:00 2001 From: John Woodlock Date: Thu, 31 May 2012 16:53:53 +1000 Subject: [PATCH] api docs update --- APIFolder/api.htm | 89 +++++++++++++++++++++++---------- APIFolder/docUpdateComments.txt | 19 ++++++- 2 files changed, 81 insertions(+), 27 deletions(-) diff --git a/APIFolder/api.htm b/APIFolder/api.htm index 9271bc53c..f048e8c4f 100644 --- a/APIFolder/api.htm +++ b/APIFolder/api.htm @@ -1604,17 +1604,34 @@ No Request Body:

Arguments
-
type
-
String Optional, case-insensitive
-
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.
+
command
+
String mandatory, case-insensitive
+
'repayment'
+ "date" is set to the date of the first outstanding installment.
+ "total" "amount" is set to the amount outstanding.
+
'waiver'
+ "date" is set to the current date.
+ "total" "amount" is set to the remaining loan principal outstanding.
-

Example Request: - https://localhost:8443/mifosng-provider/api/v1/loans/1/transactions/template?type=waiver" -

+

Example Request:

+ https://localhost:8443/mifosng-provider/api/v1/loans/10/transactions/template?command=repayment&pretty=true
GET https://thedomainname/api/v1/loans/{loanId}/transactions/template" - to be done + { + "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" + } +}
@@ -1623,22 +1640,27 @@ No Request Body:

Make a Repayment / Loan Waiver

-
type
+
command
String Optional, case-insensitive
-
The default action is to make a Loan Repayment. If the value is 'waiver' then a Loan Waiver is made.
+
'repayment' : Make Loan Repayment.
+
'waiver' : Loan Waiver.
POST https://thedomainname/api/v1/loans/{loanId}/transactions - https://localhost:8443/mifosng-provider/api/v1/loans/1/transactions - - - Content-Type: application/json - Request Body: - new json here + 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" +} { - "entityId": 2 +"entityId": 37 }
@@ -1648,13 +1670,31 @@ No Request Body:
GET https://thedomainname/api/v1/loans/{loanId}/transactions/{transactionId} - + { + "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 +}
@@ -1664,16 +1704,13 @@ No Request Body:

Adjust a Repayment or Waiver

- PUT https://thedomainname/api/v1/loans/{loanId}/transactions/{transactionId} - https://localhost:8443/mifosng-provider/api/v1/loans/1/transactions/1 - - + POST https://thedomainname/api/v1/loans/{loanId}/transactions/{transactionId} + POST https://localhost:8443/mifosng-provider/api/v1/loans/10/transactions/20 Content-Type: application/json Request Body: - new json here { - "entityId": 2 + "entityId": 10 }
diff --git a/APIFolder/docUpdateComments.txt b/APIFolder/docUpdateComments.txt index a1d1c9722..401c28794 100644 --- a/APIFolder/docUpdateComments.txt +++ b/APIFolder/docUpdateComments.txt @@ -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