From 1bd23a22d7d9a21ebea9fdae42149072d72c786c Mon Sep 17 00:00:00 2001 From: John Woodlock Date: Thu, 7 Jun 2012 22:25:34 +1000 Subject: [PATCH] api docs update --- api-docs/apiLive.htm | 48 +++++++++--------- api-docs/docUpdateComments.txt | 49 +++++-------------- .../mifosng/platform/loan/domain/Loan.java | 2 +- 3 files changed, 37 insertions(+), 62 deletions(-) diff --git a/api-docs/apiLive.htm b/api-docs/apiLive.htm index 27a4c2aa5..dcf028483 100644 --- a/api-docs/apiLive.htm +++ b/api-docs/apiLive.htm @@ -425,26 +425,24 @@ var jqxhr = $.ajax({
GET https://Domain Name/api/v1/clients [ { - "officeId" : 1, - "officeName" : "change super user", - "id" : 2, - "firstname" : "Dennis", - "lastname" : "O'Meara", - "displayName" : "Dennis O'Meara", + "officeId" : 2, + "officeName" : "sub branch 1", + "id" : 14, + "firstname" : "Patrick", + "lastname" : "Asare-Frimpong", + "displayName" : "Patrick Asare-Frimpong", "externalId" : null, - "joinedDate" : [ 2009, 1, 4 ], - "maxJoinedOnOffsetFromToday" : -1241 + "joinedDate" : [ 2012, 4, 18 ] }, { - "officeId" : 1, - "officeName" : "change super user", - "id" : 4, - "firstname" : "Jimmy", - "lastname" : "O'Meara", - "displayName" : "Jimmy O'Meara", + "officeId" : 5, + "officeName" : "Majmoua", + "id" : 13, + "firstname" : "firstMajmoua", + "lastname" : "client", + "displayName" : "firstMajmoua client", "externalId" : null, - "joinedDate" : [ 2009, 1, 11 ], - "maxJoinedOnOffsetFromToday" : -1234 -}...] + "joinedDate" : [ 2011, 12, 1 ] +}... ]
@@ -504,14 +502,13 @@ var jqxhr = $.ajax({ GET https://Domain Name/api/v1/clients/{clientId} { "officeId" : 1, - "officeName" : "change super user", + "officeName" : "Demo MFI Head Office", "id" : 1, "firstname" : "Patrick", "lastname" : "O'Meara", "displayName" : "Patrick O'Meara", "externalId" : null, - "joinedDate" : [ 2009, 1, 4 ], - "maxJoinedOnOffsetFromToday" : -1241 + "joinedDate" : [ 2009, 1, 4 ] } @@ -528,7 +525,7 @@ var jqxhr = $.ajax({

- +
Mandatory Fields
firstname, lastname, joiningDate, officeId
firstname and lastname OR clientOrBusinessName
, joiningDate, officeId
@@ -1156,7 +1153,7 @@ Request Body:
-
Mandatory Fields
clientId, productId, inArrearsTolerance, submittedOnDate, currencyCode, digitsAfterDecimal, principal, +
clientId, productId, inArrearsTolerance, submittedOnDate, principal, repaymentFrequencyType, repaymentEvery, numberOfRepayments, interestRatePerPeriod, interestRateFrequencyType, amortizationType, interestType, interestCalculationPeriodType, expectedDisbursementDate
@@ -1169,8 +1166,6 @@ Request Body: { "clientId": 1, "productId": 1, - "currencyCode": "USD", - "digitsAfterDecimal": "2", "locale": "en_GB", "principal": "100,000.00", "inArrearsTolerance": "1,000.00", @@ -1280,6 +1275,11 @@ No Request Body:
GET https://Domain Name/api/v1/loans/{loanId}/transactions/template" { + "transactionType" : { + "id" : 2, + "code" : "loanTransactionType.repayment", + "value" : "Repayment" + }, "date" : [ 2009, 8, 1 ], "total" : { "currencyCode" : "XOF", diff --git a/api-docs/docUpdateComments.txt b/api-docs/docUpdateComments.txt index 316d8a742..1d10b617a 100644 --- a/api-docs/docUpdateComments.txt +++ b/api-docs/docUpdateComments.txt @@ -1,34 +1,30 @@ -POSSIBLE CHANGES TO APP OR DOCUMENTATION - - list clients notes and a note - createdOn & updatedOn values... still need reformatting? DOING permissions? or what can happen? -------------------------------------------- - Loan Transitions ... approve etc - possible done CHECK AFTER if "eventLocalDate" parameter added with string date then instead of parameter not supported msg do get jackson conversion exception. - "JsonMappingException: Invalid format: "07 June 2012" " KW might do jackson conversion exception to json. - approve loan (already closed) with approval date before submitted date - now fine and shows json msg but if approve loan (already closed) with approval date after submitted date - DataIntegrityViolationException: Column 'loan_status_id' cannot be null; + sometimes clientId returned... always loanId OK? DOING - SEEMS DONE! - sometimes clientId returned... always loanId OK? DOING +Loan Transactions + retrieve: display transaction type value? DONE for template - no id for retrieve... but does it matter + + when adjusting a disbursal - The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.IllegalArgumentException:         Only repayment and waiver transactions can be adjusted. DONE
+    on create and adjust, app returns clientId can it be transaction id or loanId? - SEEMS TO BE LOANID :) DONE
+
+describe waiver CHECK RULES AFTER - good but maybe there should be an amount pass in ? it let me waive 12 when there was only 10 left... also more waives after that (on closed loan) caused exection - ConstraintViolationException: Column 'loan_status_id' cannot be null
+
+Loans.... "likewise for update"  there is no update.
+
+when creating loan: if arrearsTolerance left there is an exception - for the other mandatory fields... just a json msg saying it is mandatory (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)
 
-    retrieve: display transaction type value?  DOING
-    "principal" : null,   "interest" : null, total, "totalWaived" : null,   "overpaid" : null, and the offset - are nulls ever put in? DOING
-    adjust:
-
-    when adjusting a disbursal - The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.IllegalArgumentException:         Only repayment and waiver transactions can be adjusted. DOING
-    on create and adjust, app returns clientId can it be transaction id or loanId?
 
 
 
@@ -40,25 +36,4 @@ list of loan transactions not available (except in summary - presume repayments
 
 
 
-DOCUMENTATION REMAINING
-
-describe waiver CHECK RULES AFTER
-why fields "totalWaived", "overpaid" - KW DOING - CHECK AFTER
-maxJoinedOnOffsetFromToday - KW DOING - CHECK AFTER
-
-    - create a client example could show second example with the
-field clientOrBusinessName being used instead of firstname, lastname,
-no mention of it - done BUT NOTE displayName starts with space!
-
- - Loans
-     - digitsAfterDecimal and currencyCode should NOT be sent during
-creation - they should be inherited from the product. Likewise for
-update. KW DOING - CHECK AFTER
-
-     - Would be better if it was possible to not pass any of these
-details if defaults from loan product are acceptable, they can be
-inherited from loan product. KW DOING - CHECK AFTER
-
-
-
 
diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/Loan.java b/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/Loan.java
index 647b2a6cd..9a33d4cbe 100644
--- a/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/Loan.java
+++ b/mifosng-provider/src/main/java/org/mifosng/platform/loan/domain/Loan.java
@@ -338,7 +338,7 @@ public class Loan extends AbstractAuditableCustom {
 		}
 		
 		if (getTotalOutstanding().isGreaterThan(this.getInArrearsTolerance())) {
-			final String errorMessage = "Waiver is only allowed when the total outstanding amount left on loan (" + getTotalOutstanding() +") is less than thethe in arrears tolerance setting of " + getInArrearsTolerance().getAmount();
+			final String errorMessage = "Waiver is only allowed when the total outstanding amount left on loan (" + getTotalOutstanding() +") is less than the in arrears tolerance setting of " + getInArrearsTolerance().getAmount();
 			throw new InvalidLoanStateTransitionException("waive", "cannot.exceed.in.arrears.tolerance.setting", errorMessage, getTotalOutstanding(), getInArrearsTolerance());
 		}