diff --git a/APIFolder/api.htm b/APIFolder/api.htm index 1d871d976..33dbfb721 100644 --- a/APIFolder/api.htm +++ b/APIFolder/api.htm @@ -120,10 +120,9 @@ var jqxhr = $.ajax({ /v1/clients/{clientId}/notesAdd a Client NoteRetrieve a Client's Notes /v1/clients/{clientId}/notes/{noteId}Retrieve a Client NoteUpdate a Client Note LOAN/v1/loansCreate a New Loan/Submit a Loan Application - /v1/loans/{loanId}Approve, Disburse, Reject a Loan or Withdraw a Loan ApplicationRetrieve a LoanDelete a Loan - /v1/loans/{loanId}/undoUndo Loan Approval or Disbursal + /v1/loans/{loanId}Approve, Undo Approval, Disburse, Undo Disbursal, Reject a Loan or Withdraw a Loan ApplicationRetrieve a LoanDelete a Loan /v1/loans/{loanId}/transactionsMake a Repayment / Loan Waiver - /v1/loans/{loanId}/transactions/{transactionId}Retrieve a Repayment or Waiver DetailsAdjust a Repayment or Waiver + /v1/loans/{loanId}/transactions/{transactionId}Adjust a Repayment or WaiverRetrieve a Repayment or Waiver Details OFFICE/v1/officesCreate an OfficeList Offices /v1/offices/{officeId}Retrieve an OfficeUpdate an Office LOAN PRODUCT/v1/loanproductsCreate a Loan ProductList Loan Products @@ -687,50 +686,52 @@ Request Body:

Retrieve a Client's Loan Account Summary

-

Example Request: - https://localhost:8443/mifosng-provider/api/v1/clients/1/loans +

+ An example of how a loan portfolio summary can be provided. This one contains quite a bit of redundant data (like the counts) and is requested + in a specific use case of the Individual Lending User Interface.
+ However, it is quite reasonable to add resources like this to simplify User Interface development.

+

Example Request:

+ https://localhost:8443/mifosng-provider/api/v1/clients/1/loans?pretty=true +

+ https://localhost:8443/mifosng-provider/api/v1/clients/1/loans?pretty=true&fields=openLoans,%20closedLoans,activeLoanCount
GET https://thedomainname/api/v1/clients/{clientId}/loans { - "pendingApprovalLoans": [], - "awaitingDisbursalLoans": [ - { - "id": 17, - "externalId": null, - "loanProductId": 1, - "loanProductName": "Agricultural Loan", - "loanStatusId": 200, - "pendingApproval": false, - "waitingForDisbursal": true, - "open": false, - "closed": false, - "lifeCycleStatusText": "Approved", - "lifeCycleStatusDate": null - } - ], - "openLoans": [], - "closedLoans": [ - { - "id": 1, - "externalId": null, - "loanProductId": 1, - "loanProductName": "Agricultural Loan", - "loanStatusId": 600, - "pendingApproval": false, - "waitingForDisbursal": false, - "open": false, - "closed": true, - "lifeCycleStatusText": "Closed", - "lifeCycleStatusDate": null - } - ], - "anyLoanCount": 2, - "pendingApprovalLoanCount": 0, - "awaitingDisbursalLoanCount": 1, - "activeLoanCount": 0, - "closedLoanCount": 1 + "pendingApprovalLoans" : [ ], + "awaitingDisbursalLoans" : [ { + "id" : 17, + "externalId" : null, + "loanProductId" : 1, + "loanProductName" : "Agricultural Loan", + "loanStatusId" : 200, + "pendingApproval" : false, + "waitingForDisbursal" : true, + "open" : false, + "closed" : false, + "lifeCycleStatusText" : "Approved", + "lifeCycleStatusDate" : null + } ], + "openLoans" : [ ], + "closedLoans" : [ { + "id" : 1, + "externalId" : null, + "loanProductId" : 1, + "loanProductName" : "Agricultural Loan", + "loanStatusId" : 600, + "pendingApproval" : false, + "waitingForDisbursal" : false, + "open" : false, + "closed" : true, + "lifeCycleStatusText" : "Closed", + "lifeCycleStatusDate" : null + } ], + "anyLoanCount" : 2, + "pendingApprovalLoanCount" : 0, + "awaitingDisbursalLoanCount" : 1, + "activeLoanCount" : 0, + "closedLoanCount" : 1 }
@@ -741,44 +742,43 @@ Request Body:
GET https://thedomainname/api/v1/clients/{clientId}/notes -{ - "notes": [ - { - "id": 20, - "clientId": 2, - "loanId": 0, - "loanTransactionId": 0, - "noteTypeId": 100, - "note": "This is an extra note!", - "createdById": 2, - "createdByUsername": "super1", - "createdOn": "2012-04-22T13:50:25.000+01:00", - "updatedById": 2, - "updatedByUsername": "super1", - "updatedOn": "2012-04-22T13:50:25.000+01:00" - }, - { - "id": 16, - "clientId": 2, - "loanId": 0, - "loanTransactionId": 0, - "noteTypeId": 100, - "note": "loan only 1/2 amount expected\r\nyes", - "createdById": 2, - "createdByUsername": "super1", - "createdOn": "2012-04-18T15:15:04.000+01:00", - "updatedById": 2, - "updatedByUsername": "super1", - "updatedOn": "2012-04-23T09:38:13.000+01:00" - } - ] -} +[ { + "id" : 20, + "clientId" : 2, + "loanId" : null, + "loanTransactionId" : null, + "noteTypeId" : 100, + "note" : "This is an extra note!", + "createdById" : 2, + "createdByUsername" : "super1", + "createdOn" : 1335066625000, + "updatedById" : 2, + "updatedByUsername" : "super1", + "updatedOn" : 1335066625000 +}, { + "id" : 16, + "clientId" : 2, + "loanId" : null, + "loanTransactionId" : null, + "noteTypeId" : 100, + "note" : "loan only 1/2 amount expected\r\nyes", + "createdById" : 2, + "createdByUsername" : "super1", + "createdOn" : 1334726104000, + "updatedById" : 2, + "updatedByUsername" : "super1", + "updatedOn" : 1335137893000 +} ]
@@ -797,7 +797,10 @@ Request Body: "note": "a note about the client" } -{ "entityId": 40} +{ + "entityId": 40 +} +
@@ -805,25 +808,26 @@ Request Body:

Retrieve a Client Note

-

Example Request: - https://localhost:8443/mifosng-provider/api/v1/clients/1/notes/40 -

+

Example Request:

+ https://localhost:8443/mifosng-provider/api/v1/clients/2/notes/20?pretty=true +

+ https://localhost:8443/mifosng-provider/api/v1/clients/2/notes/20?pretty=true&fields=note,createdOn,createdByUsername
GET https://thedomainname/api/v1/clients/{clientId}/notes/{noteId} { - "id": 40, - "clientId": 2, - "loanId": 0, - "loanTransactionId": 0, - "noteTypeId": 100, - "note": "a note about the client", - "createdById": 1, - "createdByUsername": "mifos", - "createdOn": "2012-05-22T21:40:05.000+01:00", - "updatedById": 1, - "updatedByUsername": "mifos", - "updatedOn": "2012-05-22T21:40:05.000+01:00" + "id" : 20, + "clientId" : 2, + "loanId" : null, + "loanTransactionId" : null, + "noteTypeId" : 100, + "note" : "This is an extra note!", + "createdById" : 2, + "createdByUsername" : "super1", + "createdOn" : 1335066625000, + "updatedById" : 2, + "updatedByUsername" : "super1", + "updatedOn" : 1335066625000 }
@@ -836,14 +840,17 @@ Request Body:
PUT https://thedomainname/api/v1/clients/{clientId}/notes/{noteId} -PUT https://localhost:8443/mifosng-provider/api/v1/clients/1/notes/40 +PUT https://localhost:8443/mifosng-provider/api/v1/clients/2/notes/20 Content-Type: application/json Request Body: { -"note": "an updated note about the client" +"note": "and here the note is updated nicely." +} + +{ + "entityId": 20 } - {"entityId": 40}
@@ -1804,15 +1811,17 @@ Request Body:  
-

Approve, Disburse, Reject a Loan or Withdraw a Loan Application

+

Approve, Undo Approval, Disburse, Undo Disbursal, Reject a Loan or Withdraw a Loan Application

Arguments
command
-
String Mandatory? what happens if command wrong, , case-insensitive
+
String Mandatory, case-insensitive
'approve' : Approve Loan
'disburse' : Disburse Loan
'reject' : Reject Loan
'withdrewbyclient' : Client Withdrew Loan Application
+
'undoapproval' : Undo Loan Approval
+
'undodisbursal' : Undo Loan Disbursal
@@ -1850,33 +1859,6 @@ Request Body:
-   -
-
-

Undo Loan Approval/ Undo Loan Disbursal

-
-
command
-
String Mandatory? what happens if command wrong, , case-insensitive
-
'undoapproval' : Undo Loan Approval
-
'undodisbursal' : Undo Loan Disbursal
-
-
-
- POST https://thedomainname/api/v1/loans/{loanId}/undo - https://localhost:8443/mifosng-provider/api/v1/loans/1/undo - - - Content-Type: application/json - Request Body: - new json here - - { - "entityId": 2 -} - -
-
-  
@@ -3512,10 +3494,9 @@ Request body: /v1/clients/{clientId}/notesAdd a Client NoteRetrieve a Client's Notes /v1/clients/{clientId}/notes/{noteId}Retrieve a Client NoteUpdate a Client Note LOAN/v1/loansCreate a New Loan/Submit a Loan Application - /v1/loans/{loanId}Approve, Disburse, Reject a Loan or Withdraw a Loan ApplicationRetrieve a LoanDelete a Loan - /v1/loans/{loanId}/undoUndo Loan Approval or Disbursal + /v1/loans/{loanId}Approve, Undo Approval, Disburse, Undo Disbursal, Reject a Loan or Withdraw a Loan ApplicationRetrieve a LoanDelete a Loan /v1/loans/{loanId}/transactionsMake a Repayment / Loan Waiver - /v1/loans/{loanId}/transactions/{transactionId}Retrieve a Repayment or Waiver DetailsAdjust a Repayment or Waiver + /v1/loans/{loanId}/transactions/{transactionId}Adjust a Repayment or WaiverRetrieve a Repayment or Waiver Details OFFICE/v1/officesCreate an OfficeList Offices /v1/offices/{officeId}Retrieve an OfficeUpdate an Office LOAN PRODUCT/v1/loanproductsCreate a Loan ProductList Loan Products diff --git a/APIFolder/docUpdateComments.txt b/APIFolder/docUpdateComments.txt index 94ce78418..e5163152c 100644 --- a/APIFolder/docUpdateComments.txt +++ b/APIFolder/docUpdateComments.txt @@ -14,6 +14,12 @@ Loan Products List/Retrieve - should show textual values of enums? DOING Create - principal is later called principalMoney , also consistency between other loan fields and loan product fields with Type on them DOING +clients - parentid = id or id 1 has parentId not null DOING +list clients notes - noteType needs a 'text' + createdOn & updatedOn values... do they need reformatting? + are they ord + +updating client note - ignores clientId anyhow! so is it really a notes resource? Identify Fields that need explaining