diff --git a/APIFolder/api.htm b/APIFolder/api.htm index 10c447e2c..1d871d976 100644 --- a/APIFolder/api.htm +++ b/APIFolder/api.htm @@ -296,7 +296,8 @@ var jqxhr = $.ajax({

Dates are returned in GET requests as an array e.g. [ 2007, 4, 11]. However, they are sent as strings in POST and PUT requests. If there are any dates in your POST or PUT requests, you need to provide the "dateFormat". This can be any date pattern supported by Joda-Time. - This capability can help you when saving data in your client application as you shouldn't need to do any date format conversion prior to issuing your POST or PUT request.

+ This capability can help you when saving data in your client application as you shouldn't need to do any date format conversion prior to issuing your POST or PUT request. +

JSON examples: { @@ -309,19 +310,20 @@ JSON examples: }

Numbers

-

Similar to dates above, if you format numbers based on a "locale" in your User Interface you need to provide the "locale" when updating.. +

+ You must provide a "locale" when updating numbers. + Numbers are not "Ids" or "Types" but are typically money amounts or percentages that relate to loans. + In any case, the API will send back an error message if you forget. +

JSON examples: { -"locale": "en-us", +"locale": "en_US", "principal": "240,400.88" } { -"locale": "fr-CH", +"locale": "fr_CH", "principal": "240 400.88" -} -{ -"principal": "240400.88" } @@ -629,7 +631,11 @@ JSON examples:

Create a Client

-
+

Note: You can enter either:
+ firstname/lastname - for a person
+ OR
+ clientOrBusinessName - for a business or organisation (or person known by one name). +


@@ -3075,8 +3081,20 @@ No Request Body { "allowedOffices" : [ { "id" : 1, - "name" : "change super user" - } ], + "name" : "Demo MFI Head Office" + }, { + "id" : 2, + "name" : "sub branch 1" + }, { + "id" : 8, + "name" : "moi aussi" + }, { + "id" : 3, + "name" : "sub branch 2" + }, { + "id" : 4, + "name" : "sub branch 3" + }], "availableRoles" : [ { "id" : 1, "name" : "Super user", @@ -3089,7 +3107,25 @@ No Request Body "description" : "A field officer role allows the user to add client and loans and view reports but nothing else.", "availablePermissions" : [ ], "selectedPermissions" : [ ] - }...] + }, { + "id" : 3, + "name" : "Data Entry (Portfolio only)", + "description" : "This role allows a user full permissions around client and loan functionality but nothing else.", + "availablePermissions" : [ ], + "selectedPermissions" : [ ] + }, { + "id" : 4, + "name" : "Credit Committe Member", + "description" : "This role allows a user to approve reject or withdraw loans (with reporting).", + "availablePermissions" : [ ], + "selectedPermissions" : [ ] + }, { + "id" : 5, + "name" : "Manager", + "description" : "This role allows a manager to do anything related to portfolio management and also view all reports.", + "availablePermissions" : [ ], + "selectedPermissions" : [ ] + } ] }
@@ -3111,7 +3147,7 @@ No Request Body { "id" : 1, "officeId" : 1, - "officeName" : "change super user", + "officeName" : "Demo MFI Head Office", "username" : "mifos", "firstname" : "App", "lastname" : "Administrator", @@ -3125,15 +3161,23 @@ No Request Body "id" : 1, "name" : "User administration ALL", "description" : "An application user will have permission to execute all tasks related to user administration.", - "code" : "USER_ADMINISTRATION_SUPER_USER_ROLE", - "groupType" : 1 + "code" : "USER_ADMINISTRATION_SUPER_USER_ROLE" }, { "id" : 4, "name" : "Reporting ALL", "description" : "An application user will have permission to execute and view all reports.", - "code" : "REPORTING_SUPER_USER_ROLE", - "groupType" : 4 - }...] + "code" : "REPORTING_SUPER_USER_ROLE" + }, { + "id" : 3, + "name" : "Portfolio management ALL", + "description" : "An application user will have permission to execute all tasks related to portfolio management.", + "code" : "PORTFOLIO_MANAGEMENT_SUPER_USER_ROLE" + }, { + "id" : 2, + "name" : "Organisation adminsitration ALL", + "description" : "An application user will have permission to execute all tasks related to organisation administration.", + "code" : "ORGANISATION_ADMINISTRATION_SUPER_USER_ROLE" + } ] } ] } @@ -3291,20 +3335,22 @@ No Request Body "id" : 1, "name" : "User administration ALL", "description" : "An application user will have permission to execute all tasks related to user administration.", - "code" : "USER_ADMINISTRATION_SUPER_USER_ROLE", - "groupType" : 1 + "code" : "USER_ADMINISTRATION_SUPER_USER_ROLE" }, { "id" : 2, "name" : "Organisation adminsitration ALL", "description" : "An application user will have permission to execute all tasks related to organisation administration.", - "code" : "ORGANISATION_ADMINISTRATION_SUPER_USER_ROLE", - "groupType" : 2 + "code" : "ORGANISATION_ADMINISTRATION_SUPER_USER_ROLE" }, { "id" : 3, "name" : "Portfolio management ALL", "description" : "An application user will have permission to execute all tasks related to portfolio management.", - "code" : "PORTFOLIO_MANAGEMENT_SUPER_USER_ROLE", - "groupType" : 3 + "code" : "PORTFOLIO_MANAGEMENT_SUPER_USER_ROLE" + }, { + "id" : 4, + "name" : "Reporting ALL", + "description" : "An application user will have permission to execute and view all reports.", + "code" : "REPORTING_SUPER_USER_ROLE" }...] } @@ -3332,26 +3378,22 @@ No Request Body "id" : 1, "name" : "User administration ALL", "description" : "An application user will have permission to execute all tasks related to user administration.", - "code" : "USER_ADMINISTRATION_SUPER_USER_ROLE", - "groupType" : 1 + "code" : "USER_ADMINISTRATION_SUPER_USER_ROLE" }, { "id" : 4, "name" : "Reporting ALL", "description" : "An application user will have permission to execute and view all reports.", - "code" : "REPORTING_SUPER_USER_ROLE", - "groupType" : 4 + "code" : "REPORTING_SUPER_USER_ROLE" }, { "id" : 3, "name" : "Portfolio management ALL", "description" : "An application user will have permission to execute all tasks related to portfolio management.", - "code" : "PORTFOLIO_MANAGEMENT_SUPER_USER_ROLE", - "groupType" : 3 + "code" : "PORTFOLIO_MANAGEMENT_SUPER_USER_ROLE" }, { "id" : 2, "name" : "Organisation adminsitration ALL", "description" : "An application user will have permission to execute all tasks related to organisation administration.", - "code" : "ORGANISATION_ADMINISTRATION_SUPER_USER_ROLE", - "groupType" : 2 + "code" : "ORGANISATION_ADMINISTRATION_SUPER_USER_ROLE" } ] } @@ -3434,21 +3476,23 @@ Request body: "id" : 1, "name" : "User administration ALL", "description" : "An application user will have permission to execute all tasks related to user administration.", - "code" : "USER_ADMINISTRATION_SUPER_USER_ROLE", - "groupType" : 1 + "code" : "USER_ADMINISTRATION_SUPER_USER_ROLE" }, { "id" : 2, "name" : "Organisation adminsitration ALL", "description" : "An application user will have permission to execute all tasks related to organisation administration.", - "code" : "ORGANISATION_ADMINISTRATION_SUPER_USER_ROLE", - "groupType" : 2 + "code" : "ORGANISATION_ADMINISTRATION_SUPER_USER_ROLE" }, { "id" : 3, "name" : "Portfolio management ALL", "description" : "An application user will have permission to execute all tasks related to portfolio management.", - "code" : "PORTFOLIO_MANAGEMENT_SUPER_USER_ROLE", - "groupType" : 3 -}...] + "code" : "PORTFOLIO_MANAGEMENT_SUPER_USER_ROLE" +}, { + "id" : 4, + "name" : "Reporting ALL", + "description" : "An application user will have permission to execute and view all reports.", + "code" : "REPORTING_SUPER_USER_ROLE" +}, ... ]
diff --git a/APIFolder/docUpdateComments.txt b/APIFolder/docUpdateComments.txt index bdd797c01..94ce78418 100644 --- a/APIFolder/docUpdateComments.txt +++ b/APIFolder/docUpdateComments.txt @@ -2,32 +2,22 @@ template for waiver/repayment... is it same for both? no type needed? (might have got this wrong) new loan template ... is it 2 templates... one to pick product... and 2nd to return default properties in selected product or is it meant that if only one product then use that. +recreate() --------------------------------------------------------- - Lost permissions again... restore fixed it up... must be some prob with permissions/roles maintenance also, maybe I should be using a user that has everything but role admin. -go thru questions over mandatory fields -also about formation numbers with locale... can i put a dodgey one in and mess up data unknowingly? - -Permissions -groupType in or out? - -users - delete still falls over if user doesn't exist. -Roles - -"id" is a mandatory field (says something about updating in the msg) +users - delete still falls over if user doesn't exist. DOING Loan Products -List/Retrieve - should show textual values of enums? -Create - currencyDigitsAfterDecimal is it needed? (maybe customising digits after decimal by loan product not just currency) - is locale saved? - principal is later called principalMoney +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 + + +Identify Fields that need explaining Clients displayName, externalId, maxJoinedOnOffsetFromToday -business name? diff --git a/mifosng-data/src/main/java/org/mifosng/data/PermissionData.java b/mifosng-data/src/main/java/org/mifosng/data/PermissionData.java index c42026a0b..4c00b84fe 100644 --- a/mifosng-data/src/main/java/org/mifosng/data/PermissionData.java +++ b/mifosng-data/src/main/java/org/mifosng/data/PermissionData.java @@ -5,7 +5,7 @@ import java.io.Serializable; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.map.annotate.JsonFilter; -@JsonIgnoreProperties({ "orgId" }) +@JsonIgnoreProperties({ "orgId", "groupType" }) @JsonFilter("permissionFilter") public class PermissionData implements Serializable { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/ApiJSONFormattingServiceImpl.java b/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/ApiJSONFormattingServiceImpl.java index dc5c93733..d8f0b9e8c 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/ApiJSONFormattingServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/ApiJSONFormattingServiceImpl.java @@ -162,12 +162,6 @@ public class ApiJSONFormattingServiceImpl implements ApiJSONFormattingService { if (filterName.equals("roleFilter")) { Set permissionFields = new HashSet(); - // Ask keith which ones to show - permissionFields.add("id"); - permissionFields.add("name"); - permissionFields.add("description"); - permissionFields.add("code"); - permissionFields.add("groupType"); if (filterType.equals("I")) { return new SimpleFilterProvider().addFilter( @@ -176,7 +170,7 @@ public class ApiJSONFormattingServiceImpl implements ApiJSONFormattingService { .filterOutAllExcept(filterFields)).addFilter( "permissionFilter", SimpleBeanPropertyFilter - .filterOutAllExcept(permissionFields)); + .serializeAllExcept(permissionFields)); } @@ -185,25 +179,13 @@ public class ApiJSONFormattingServiceImpl implements ApiJSONFormattingService { .addFilter( "permissionFilter", SimpleBeanPropertyFilter - .filterOutAllExcept(permissionFields)); + .serializeAllExcept(permissionFields)); } if (filterName.equals("userFilter")) { Set roleFields = new HashSet(); - roleFields.add("id"); - roleFields.add("name"); - roleFields.add("description"); - roleFields.add("availablePermissions"); - roleFields.add("selectedPermissions"); - // Ask keith which ones to show Set permissionFields = new HashSet(); - // Ask keith which ones to show - permissionFields.add("id"); - permissionFields.add("name"); - permissionFields.add("description"); - permissionFields.add("code"); - permissionFields.add("groupType"); if (filterType.equals("I")) { return new SimpleFilterProvider() @@ -214,11 +196,11 @@ public class ApiJSONFormattingServiceImpl implements ApiJSONFormattingService { .addFilter( "roleFilter", SimpleBeanPropertyFilter - .filterOutAllExcept(roleFields)) + .serializeAllExcept(roleFields)) .addFilter( "permissionFilter", SimpleBeanPropertyFilter - .filterOutAllExcept(permissionFields)); + .serializeAllExcept(permissionFields)); } @@ -230,11 +212,11 @@ public class ApiJSONFormattingServiceImpl implements ApiJSONFormattingService { .addFilter( "roleFilter", SimpleBeanPropertyFilter - .filterOutAllExcept(roleFields)) + .serializeAllExcept(roleFields)) .addFilter( "permissionFilter", SimpleBeanPropertyFilter - .filterOutAllExcept(permissionFields)); + .serializeAllExcept(permissionFields)); } return filters;