From 99a3df538f8f6883ab1cbd344bd580f898e33fc3 Mon Sep 17 00:00:00 2001 From: Keith Woodlock Date: Mon, 21 May 2012 20:23:11 +0100 Subject: [PATCH] start with update of basic office api info. --- APIFolder/api.htm | 164 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 135 insertions(+), 29 deletions(-) diff --git a/APIFolder/api.htm b/APIFolder/api.htm index c455629b7..b3a49dcd4 100644 --- a/APIFolder/api.htm +++ b/APIFolder/api.htm @@ -419,67 +419,173 @@

Offices

-

The Office and Branch hierarchy. -

+

Offices are used to model an MFIs structure. A hierarchial representation of offices is supported. + There will always be at least one office (which represents the MFI or an MFIs head office). + All subsequent offices added must have a parent office.

+  
GET https://thedomainname/api/v1/offices - to be done - + +{ + "offices": [ + { + "id": 1, + "name": "Demo MFI Head Office", + "externalId": "1", + "openingDate": "2009-01-01", + "hierarchy": ".", + "parentName": null, + "parentId": 0, + "allowedParents": [] + }, + { + "id": 2, + "name": "sub branch 1", + "externalId": "2", + "openingDate": "2012-01-02", + "hierarchy": ".2.", + "parentName": "Demo MFI Head Office", + "parentId": 1, + "allowedParents": [] + }, + { + "id": 3, + "name": "sub branch 2", + "externalId": "3", + "openingDate": "2012-03-01", + "hierarchy": ".3.", + "parentName": "Demo MFI Head Office", + "parentId": 1, + "allowedParents": [] + } + ] +} +
- - +  

Retrieve Office Details Template

-

Returns a template that contains the office fields and allowed value lists. This helps build a maintenance User Interface. +

Returns a template that contains the office fields and allowed value lists. This is a convienence when building user intereface screens for client applications.

Example Request: - http://localhost:8080/mifosng-provider/api/v1/offices/template + + https://localhost:8443/mifosng-provider/api/v1/offices/template +

GET https://thedomainname/api/v1/offices/template - to be done - + +{ + "id": null, + "name": null, + "externalId": null, + "openingDate": "2012-05-21", + "hierarchy": null, + "parentName": null, + "parentId": null, + "allowedParents": [ + { + "id": 1, + "name": "Demo MFI Head Office", + "externalId": "1", + "openingDate": "2009-01-01", + "hierarchy": ".", + "parentName": null, + "parentId": 0, + "allowedParents": [] + }, + { + "id": 2, + "name": "sub branch 1", + "externalId": "2", + "openingDate": "2012-01-02", + "hierarchy": ".2.", + "parentName": "Demo MFI Head Office", + "parentId": 1, + "allowedParents": [] + }, + { + "id": 3, + "name": "sub branch 2", + "externalId": "3", + "openingDate": "2012-03-01", + "hierarchy": ".3.", + "parentName": "Demo MFI Head Office", + "parentId": 1, + "allowedParents": [] + }, + { + "id": 4, + "name": "sub branch 3", + "externalId": null, + "openingDate": "2012-04-17", + "hierarchy": ".4.", + "parentName": "Demo MFI Head Office", + "parentId": 1, + "allowedParents": [] + } + ] +} + +
+
+ +   +
+
+

Retrieve Office

+

Returns an office details if it exists.

+

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

+
+
+ GET https://thedomainname/api/v1/offices/1 + +{ + "id": 1, + "name": "Demo MFI Head Office", + "externalId": "1", + "openingDate": "2009-01-01", + "hierarchy": ".", + "parentName": null, + "parentId": 0, + "allowedParents": [] +} +
-