This is an automated email from the ASF dual-hosted git repository.

angeh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/fineract-cn-docker-compose.git

commit 252574ee0a8c540adee4d0917ae684f4720cefeb
Author: Juhan Aasaru <[email protected]>
AuthorDate: Thu Sep 5 17:10:44 2019 +0300

    add fims-web-app
    add Postman provisioning scripts taken from 
https://github.com/vishwasbabu/ProvisioningFineractCN
    rename ledger-ms to accounting-ms
---
 README.md                                          | 113 ++-
 docker-compose.yml                                 |  17 +-
 ...act-Cn-Initial-Requests.postman_collection.json | 872 +++++++++++++++++++++
 ...tial-Setup-Environment.postman_environment.json |  84 ++
 4 files changed, 1081 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index d212b5c..f418afc 100644
--- a/README.md
+++ b/README.md
@@ -29,20 +29,127 @@ docker-compose up
 ```
 
 ### Choose the services you want to run
-In the docker-compose.yml (that resides in project root) comment out the 
services  you don't want to run.
+In the docker-compose.yml (that resides in project root) there are more than 
10 services defined.
 Running all services together consumes a lot of memory.
 
 
 ### Start micro services
+First only start provisioner-ms by running following in project root:
 
-In project root directory run:
 ```
+docker-compose up provisioner-ms 
+```
+
+after it has started (and created table seshat to postgres) stop it and start 
a subset of services.
+
+For example you could start the following micro services and an fims-web-app
+
+```
+docker-compose up provisioner-ms identity-ms office-ms customer-ms 
accounting-ms fims-web-app
+```
+If you want you can add other micro services (listed in docker-compose.yml) to 
the list, for example
+ you could also add deposit-account-management-ms
+
+# Provision
+
+## Provisioning the Micro Services Using Postman
+
+We provide a postman-request-collection as well as a postman-environment that 
defines variables that are used to hold values received in responses.
+Both files are located under [postman-initial-requests 
folder](postman_scripts):
+```
+postman_scripts/Fineract-Cn-Initial-Requests.postman_collection.json
+postman_scripts/Fineract-Cn-Initial-Setup-Environment.postman_environment.json
+```
+
+Initialize Postman as follows:
+
+1. Start Postman and load both files into Postman by clicking ```Import``` and 
then selecting the file.
+2. You will see the collection "Fineract-Cn-Initial-Requests" in the left 
sidebar.
+3. Open the collection by clicking on it.
+4. Select the environment "Fineract-Cn-Initial-Setup-Environment" in the 
environment drop-down (top right corner in Postman).
+5. Execute the requests one by one by selecting them in the collection and 
then pressing "Send".
+
+
+The first request will retrieve a token. The response should look like this, 
with a different token:
+
+```
+{
+    "token": "Bearer 
eyJhbGciOiJSUzUxMiJ9.eyJhdWQiOiJwcm92aXNpb25lci12MSIsInN1YiI6IndlcGVtbmVmcmV0IiwiL21pZm9zLmlvL3NpZ25hdHVyZVRpbWVzdGFtcCI6IjIwMTctMDQtMThUMDlfNDRfMjIiLCIvbWlmb3MuaW8vdG9rZW5Db250ZW50IjoiUk9MRV9BRE1JTiIsImlzcyI6InN5c3RlbSIsImlhdCI6MTUwMDA1NjgxNywiZXhwIjoxNTAwNDE2ODE3fQ.OfxTUTStJbKQc4rAPW5PLIQYNjCG_uqcNPR4up6pIQBWLDxkgEiU9EF1WrB5NQdzXBJIHqjDFQpaVywm5DersIh4LxPGD3MZj3TqZK5_LUcZvBDTa4Xgb41e3xXkWB4TkN6KqfmiK12Ngjrrj7qZGBdtypDmFmZwKQRZIOL6T3QbI7LpbPGpeWjpWZirFgtcn5B1Z_h3r9r
 [...]
+    "accessTokenExpiration": "2019-07-18T22:26:57.784"
+}
+```
+
+If you don't get a token there is something wrong with your setup. The token 
is necessary for authentication in other requests thus be sure that this steps 
works.
+
+Important: Be sure to execute the requests in the right order! If you execute 
the requests that gives you the initial password (request "03.2 Create Identity 
Service for Tenant") twice you will not be able to retrieve the initial 
password again (due to the implementation of the identity service).
+If that happens the variable antonyUserPassword is empty (undefined) and you 
will not be able to sign in antony and change his password (03.3, 03.4).
+
+6. If you didn't start the micro service deposit-account-management-ms with 
docker-compose then
+you can assign deposits app to tenant (in step 07.1 and 07.2) but these 
services won't work.
+
+
+#### Debugging help
+
+1. Check if the micro services to which the requests are made are up and 
running.
+Check the container for details of failures (if any):
+
+docker-compose logs provisioner-ms
+
+
+2. Reach out to [mailing 
list](https://lists.apache.org/[email protected]) with the 
relevant details
+
+
+### Sign-in using fims-web-app
+
+Prerequisites: Fineract-CN has been successfully provisioned by following the 
instructions in the previous sections
+User ```mifos``` is created in the the last two requests (user creation and 
role assignment) in the postman request-list.
+This user has admin rights and is able to manage offices,customers and thier 
deposits.
+
+Navigate to http://localhost:8888 in your browser and enter the credentials of 
the user you want to sign in with.
+
+The following user-profile is available in fims-web-app after above setup was 
completed successfully:
+
+```
+tenant: playground
+user: mifos
+password: password
+```
+
+### Use the Postman scripts when running locally
+Postman scripts use service names (postgres, provisioner-ms, etc) when 
refering to different services.
+If you want to use the same Postman scripts when running micro services 
locally then add into your hosts (/etc/hosts in Unix) file:
+
+```
+127.0.0.1 provisioner-ms
+127.0.0.1 identity-ms
+127.0.0.1 office-ms
+127.0.0.1 customer-ms
+127.0.0.1 portfolio-ms
+127.0.0.1 accounting-ms
+127.0.0.1 deposit-account-management-ms
+127.0.0.1 teller-ms
+127.0.0.1 reporting-ms
+127.0.0.1 cheques-ms
+127.0.0.1 payroll-ms
+127.0.0.1 group-ms
+127.0.0.1 postgres
+```
+
+### How to reset everything and start from scratch
+
+```
+cd external-tools
+docker-compose stop
+docker-compose rm
+docker volume rm external_tools_cassandra-volume
+docker volume rm external_tools_postgres-volume
 docker-compose up
 ```
 
+
 ## TODO
 
-- Provision the web services
+- Provision the web services using a script
 - Adjust scripts for Kubernetes
 
 There are some scripts in 
[https://github.com/openMF/fineract-cn-containers](https://github.com/openMF/fineract-cn-containers)
diff --git a/docker-compose.yml b/docker-compose.yml
index 7ae1011..d110ee2 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -58,7 +58,7 @@ services:
     networks:
       - external_tools_default
 
-# HAS ERRORS:
+# TODO HAS ERRORS:
 #  rhythm-ms:
 #    image: apache/fineract-cn-rhythm:latest
 #    environment:
@@ -117,7 +117,7 @@ services:
     networks:
       - external_tools_default
 
-  ledger-ms:
+  accounting-ms:
     ports:
       - "2025:2025"
     image: apache/fineract-cn-accounting:latest
@@ -205,6 +205,9 @@ services:
       system.publicKey.timestamp: ${PUBLIC_KEY_TIMESTAMP}
     networks:
       - external_tools_default
+#
+# TODO add checques-ms
+#
 
   payroll-ms:
     image: apache/fineract-cn-payroll:latest
@@ -223,6 +226,16 @@ services:
       system.publicKey.timestamp: ${PUBLIC_KEY_TIMESTAMP}
     networks:
       - external_tools_default
+#
+# TODO group-ms
+#
+
+  fims-web-app:
+    image: aasaru/fineract-cn-fims-web-app:latest # TODO switch to apache repo
+    ports:
+      - "8888:8888"
+    networks:
+      - external_tools_default
 
 networks:
   external_tools_default:
diff --git 
a/postman_scripts/Fineract-Cn-Initial-Requests.postman_collection.json 
b/postman_scripts/Fineract-Cn-Initial-Requests.postman_collection.json
new file mode 100644
index 0000000..be8eac2
--- /dev/null
+++ b/postman_scripts/Fineract-Cn-Initial-Requests.postman_collection.json
@@ -0,0 +1,872 @@
+{
+       "info": {
+               "_postman_id": "16b8ce24-0311-498b-b248-b91ddcc14b08",
+               "name": "Fineract-Initial-Requests",
+               "description": "Collection to initialize tenant",
+               "schema": 
"https://schema.getpostman.com/json/collection/v2.1.0/collection.json";
+       },
+       "item": [
+               {
+                       "name": "01. Get token from system user",
+                       "event": [
+                               {
+                                       "listen": "test",
+                                       "script": {
+                                               "id": 
"2a49d9a1-377c-4c03-90b8-1c285140de5a",
+                                               "exec": [
+                                                       "tests[\"Status code is 
200\"] = responseCode.code === 200;",
+                                                       "",
+                                                       "var jsonData = 
JSON.parse(responseBody);",
+                                                       
"postman.setEnvironmentVariable(\"rootUserToken\", jsonData.token);",
+                                                       "",
+                                                       "",
+                                                       ""
+                                               ],
+                                               "type": "text/javascript"
+                                       }
+                               }
+                       ],
+                       "request": {
+                               "method": "POST",
+                               "header": [],
+                               "url": {
+                                       "raw": 
"http://{{provisionerUrl}}/provisioner/v1/auth/token?grant_type=password&client_id={{client_id}}&username={{rootUser}}&password={{rootUserPassword}}";,
+                                       "protocol": "http",
+                                       "host": [
+                                               "{{provisionerUrl}}"
+                                       ],
+                                       "path": [
+                                               "provisioner",
+                                               "v1",
+                                               "auth",
+                                               "token"
+                                       ],
+                                       "query": [
+                                               {
+                                                       "key": "grant_type",
+                                                       "value": "password"
+                                               },
+                                               {
+                                                       "key": "client_id",
+                                                       "value": 
"{{client_id}}",
+                                                       "description": "The 
initial Client Id used for starting service runner\n"
+                                               },
+                                               {
+                                                       "key": "username",
+                                                       "value": "{{rootUser}}",
+                                                       "description": "Initial 
system user \"wepemnefret\"\n"
+                                               },
+                                               {
+                                                       "key": "password",
+                                                       "value": 
"{{rootUserPassword}}"
+                                               }
+                                       ]
+                               },
+                               "description": "1. Get Token from System-User"
+                       },
+                       "response": []
+               },
+               {
+                       "name": "02. Create first tenant",
+                       "request": {
+                               "method": "POST",
+                               "header": [
+                                       {
+                                               "key": "Authorization",
+                                               "value": "{{rootUserToken}}"
+                                       },
+                                       {
+                                               "key": "User",
+                                               "value": "{{rootUser}}"
+                                       },
+                                       {
+                                               "key": "Content-Type",
+                                               "value": "application/json"
+                                       }
+                               ],
+                               "body": {
+                                       "mode": "raw",
+                                       "raw": "{\n\t\"identifier\": 
\"{{tenantIdentifier}}\",\n\t\"name\": \"Playground\",\n\t\"description\": 
\"Sample tenant for demonstrating Fineract-CN 
functionality\",\n\t\"cassandraConnectionInfo\": {\n\t\t\"clusterName\": 
\"Datacenter1\",\n\t\t\"contactPoints\": \"127.0.0.1:9042\",\n\t\t\"keyspace\": 
\"playground\",\n\t\t\"replicationType\": \"Simple\",\n\t\t\"replicas\": 
\"1\"\n\t},\n\t\"databaseConnectionInfo\": {\n\t\t\"driverClass\": 
\"org.mariadb.jdbc.Driver\",\n\t\t\"database [...]
+                               },
+                               "url": {
+                                       "raw": 
"http://{{provisionerUrl}}/provisioner/v1/tenants";,
+                                       "protocol": "http",
+                                       "host": [
+                                               "{{provisionerUrl}}"
+                                       ],
+                                       "path": [
+                                               "provisioner",
+                                               "v1",
+                                               "tenants"
+                                       ]
+                               }
+                       },
+                       "response": []
+               },
+               {
+                       "name": "03.1 Create identity-v1 application",
+                       "request": {
+                               "method": "POST",
+                               "header": [
+                                       {
+                                               "key": "Authorization",
+                                               "value": "{{rootUserToken}}"
+                                       },
+                                       {
+                                               "key": "User",
+                                               "value": "{{rootUser}}"
+                                       },
+                                       {
+                                               "key": "Content-Type",
+                                               "value": "application/json"
+                                       },
+                                       {
+                                               "key": "X-Tenant-Identifier",
+                                               "value": "{{tenantIdentifier}}",
+                                               "type": "text",
+                                               "disabled": true
+                                       }
+                               ],
+                               "body": {
+                                       "mode": "raw",
+                                       "raw": "{\n\t\"name\": 
\"identity-v1\",\n\t\"description\": \"Identity Service\",\n\t\"vendor\": 
\"Apache Fineract\",\n\t\"homepage\": \"http://localhost:2021/identity/v1\"\n}";
+                               },
+                               "url": {
+                                       "raw": 
"http://{{provisionerUrl}}/provisioner/v1/applications";,
+                                       "protocol": "http",
+                                       "host": [
+                                               "{{provisionerUrl}}"
+                                       ],
+                                       "path": [
+                                               "provisioner",
+                                               "v1",
+                                               "applications"
+                                       ]
+                               }
+                       },
+                       "response": []
+               },
+               {
+                       "name": "03.2 Assign Identity Manager for Tenant",
+                       "event": [
+                               {
+                                       "listen": "test",
+                                       "script": {
+                                               "id": 
"206c2d92-7c20-46e9-8079-ead0c0adbbe0",
+                                               "exec": [
+                                                       "tests[\"Status code is 
200\"] = responseCode.code === 200;",
+                                                       "",
+                                                       "var jsonData = 
JSON.parse(responseBody);",
+                                                       
"postman.setEnvironmentVariable(\"antonyUserPassword\", 
jsonData.adminPassword);",
+                                                       "",
+                                                       "",
+                                                       ""
+                                               ],
+                                               "type": "text/javascript"
+                                       }
+                               }
+                       ],
+                       "request": {
+                               "method": "POST",
+                               "header": [
+                                       {
+                                               "key": "Authorization",
+                                               "value": "{{rootUserToken}}"
+                                       },
+                                       {
+                                               "key": "User",
+                                               "value": "{{rootUser}}"
+                                       },
+                                       {
+                                               "key": "Content-Type",
+                                               "value": "application/json"
+                                       },
+                                       {
+                                               "key": "X-Tenant-Identifier",
+                                               "value": "{{tenantIdentifier}}"
+                                       }
+                               ],
+                               "body": {
+                                       "mode": "raw",
+                                       "raw": "{\n\t\"name\": 
\"identity-v1\"\n}"
+                               },
+                               "url": {
+                                       "raw": 
"http://{{provisionerUrl}}/provisioner/v1/tenants/{{tenantIdentifier}}/identityservice";,
+                                       "protocol": "http",
+                                       "host": [
+                                               "{{provisionerUrl}}"
+                                       ],
+                                       "path": [
+                                               "provisioner",
+                                               "v1",
+                                               "tenants",
+                                               "{{tenantIdentifier}}",
+                                               "identityservice"
+                                       ]
+                               }
+                       },
+                       "response": []
+               },
+               {
+                       "name": "03.3 Login Antony",
+                       "event": [
+                               {
+                                       "listen": "test",
+                                       "script": {
+                                               "type": "text/javascript",
+                                               "exec": [
+                                                       "tests[\"Status code is 
200\"] = responseCode.code === 200;",
+                                                       "",
+                                                       "var jsonData = 
JSON.parse(responseBody);",
+                                                       
"postman.setEnvironmentVariable(\"antonyToken\", jsonData.accessToken);",
+                                                       "",
+                                                       "",
+                                                       ""
+                                               ]
+                                       }
+                               }
+                       ],
+                       "request": {
+                               "method": "POST",
+                               "header": [
+                                       {
+                                               "key": "X-Tenant-Identifier",
+                                               "value": "{{tenantIdentifier}}"
+                                       },
+                                       {
+                                               "key": "Content-Type",
+                                               "value": "application/json"
+                                       }
+                               ],
+                               "body": {
+                                       "mode": "raw",
+                                       "raw": "{}"
+                               },
+                               "url": {
+                                       "raw": 
"http://{{identityUrl}}/identity/v1/token?grant_type=password&username=antony&password={{antonyUserPassword}}";,
+                                       "protocol": "http",
+                                       "host": [
+                                               "{{identityUrl}}"
+                                       ],
+                                       "path": [
+                                               "identity",
+                                               "v1",
+                                               "token"
+                                       ],
+                                       "query": [
+                                               {
+                                                       "key": "grant_type",
+                                                       "value": "password"
+                                               },
+                                               {
+                                                       "key": "username",
+                                                       "value": "antony"
+                                               },
+                                               {
+                                                       "key": "password",
+                                                       "value": 
"{{antonyUserPassword}}"
+                                               }
+                                       ]
+                               }
+                       },
+                       "response": []
+               },
+               {
+                       "name": "03.4 Change Antony Password",
+                       "event": [
+                               {
+                                       "listen": "test",
+                                       "script": {
+                                               "type": "text/javascript",
+                                               "exec": [
+                                                       "tests[\"Status code is 
202\"] = responseCode.code === 202;",
+                                                       "",
+                                                       
"postman.setEnvironmentVariable(\"antonyUserPassword\", \"dGVzdA==\");",
+                                                       "",
+                                                       "",
+                                                       ""
+                                               ]
+                                       }
+                               }
+                       ],
+                       "request": {
+                               "method": "PUT",
+                               "header": [
+                                       {
+                                               "key": "Authorization",
+                                               "value": "{{antonyToken}}"
+                                       },
+                                       {
+                                               "key": "User",
+                                               "value": "{{antonyUser}}"
+                                       },
+                                       {
+                                               "key": "Content-Type",
+                                               "value": "application/json"
+                                       },
+                                       {
+                                               "key": "X-Tenant-Identifier",
+                                               "value": "{{tenantIdentifier}}"
+                                       }
+                               ],
+                               "body": {
+                                       "mode": "raw",
+                                       "raw": "{\n\t\"password\": 
\"dGVzdA==\"\n}"
+                               },
+                               "url": {
+                                       "raw": 
"http://{{identityUrl}}/identity/v1/users/antony/password";,
+                                       "protocol": "http",
+                                       "host": [
+                                               "{{identityUrl}}"
+                                       ],
+                                       "path": [
+                                               "identity",
+                                               "v1",
+                                               "users",
+                                               "antony",
+                                               "password"
+                                       ]
+                               }
+                       },
+                       "response": []
+               },
+               {
+                       "name": "03.5 Login Antony with new password",
+                       "event": [
+                               {
+                                       "listen": "test",
+                                       "script": {
+                                               "type": "text/javascript",
+                                               "exec": [
+                                                       "tests[\"Status code is 
200\"] = responseCode.code === 200;",
+                                                       "",
+                                                       "var jsonData = 
JSON.parse(responseBody);",
+                                                       
"postman.setEnvironmentVariable(\"antonyToken\", jsonData.accessToken);",
+                                                       "",
+                                                       "",
+                                                       ""
+                                               ]
+                                       }
+                               }
+                       ],
+                       "request": {
+                               "method": "POST",
+                               "header": [
+                                       {
+                                               "key": "X-Tenant-Identifier",
+                                               "value": "{{tenantIdentifier}}"
+                                       },
+                                       {
+                                               "key": "Content-Type",
+                                               "value": "application/json"
+                                       }
+                               ],
+                               "body": {
+                                       "mode": "raw",
+                                       "raw": "{}"
+                               },
+                               "url": {
+                                       "raw": 
"http://{{identityUrl}}/identity/v1/token?grant_type=password&username={{antonyUser}}&password={{antonyUserPassword}}";,
+                                       "protocol": "http",
+                                       "host": [
+                                               "{{identityUrl}}"
+                                       ],
+                                       "path": [
+                                               "identity",
+                                               "v1",
+                                               "token"
+                                       ],
+                                       "query": [
+                                               {
+                                                       "key": "grant_type",
+                                                       "value": "password"
+                                               },
+                                               {
+                                                       "key": "username",
+                                                       "value": 
"{{antonyUser}}"
+                                               },
+                                               {
+                                                       "key": "password",
+                                                       "value": 
"{{antonyUserPassword}}"
+                                               }
+                                       ]
+                               }
+                       },
+                       "response": []
+               },
+               {
+                       "name": "03.6 Assign Identity for Tenant",
+                       "request": {
+                               "method": "PUT",
+                               "header": [
+                                       {
+                                               "key": "Authorization",
+                                               "value": "{{rootUserToken}}"
+                                       },
+                                       {
+                                               "key": "User",
+                                               "value": "{{rootUser}}"
+                                       },
+                                       {
+                                               "key": "Content-Type",
+                                               "value": "application/json"
+                                       },
+                                       {
+                                               "key": "X-Tenant-Identifier",
+                                               "value": "{{tenantIdentifier}}"
+                                       }
+                               ],
+                               "body": {
+                                       "mode": "raw",
+                                       "raw": "[\n\t{\n\t\t\"name\": 
\"identity-v1\"\n\t}\n]"
+                               },
+                               "url": {
+                                       "raw": 
"http://{{provisionerUrl}}/provisioner/v1/tenants/s{{tenantIdentifier}}/applications";,
+                                       "protocol": "http",
+                                       "host": [
+                                               "{{provisionerUrl}}"
+                                       ],
+                                       "path": [
+                                               "provisioner",
+                                               "v1",
+                                               "tenants",
+                                               "s{{tenantIdentifier}}",
+                                               "applications"
+                                       ]
+                               }
+                       },
+                       "response": []
+               },
+               {
+                       "name": "04.1 Create office-v1 application",
+                       "request": {
+                               "method": "POST",
+                               "header": [
+                                       {
+                                               "key": "Authorization",
+                                               "value": "{{rootUserToken}}"
+                                       },
+                                       {
+                                               "key": "User",
+                                               "value": "{{rootUser}}"
+                                       },
+                                       {
+                                               "key": "Content-Type",
+                                               "value": "application/json"
+                                       },
+                                       {
+                                               "key": "X-Tenant-Identifier",
+                                               "value": "{{tenantIdentifier}}"
+                                       }
+                               ],
+                               "body": {
+                                       "mode": "raw",
+                                       "raw": "{\n\t\"name\": 
\"office-v1\",\n\t\"description\": \"Office Service\",\n\t\"vendor\": \"Apache 
Fineract\",\n\t\"homepage\": \"http://localhost:2023/office/v1\"\n}";
+                               },
+                               "url": {
+                                       "raw": 
"http://{{provisionerUrl}}/provisioner/v1/applications";,
+                                       "protocol": "http",
+                                       "host": [
+                                               "{{provisionerUrl}}"
+                                       ],
+                                       "path": [
+                                               "provisioner",
+                                               "v1",
+                                               "applications"
+                                       ]
+                               }
+                       },
+                       "response": []
+               },
+               {
+                       "name": "04.2 Assign Office for Tenant",
+                       "request": {
+                               "method": "PUT",
+                               "header": [
+                                       {
+                                               "key": "Authorization",
+                                               "value": "{{rootUserToken}}"
+                                       },
+                                       {
+                                               "key": "User",
+                                               "value": "{{rootUser}}"
+                                       },
+                                       {
+                                               "key": "Content-Type",
+                                               "value": "application/json"
+                                       },
+                                       {
+                                               "key": "X-Tenant-Identifier",
+                                               "value": "{{tenantIdentifier}}"
+                                       }
+                               ],
+                               "body": {
+                                       "mode": "raw",
+                                       "raw": "[\n\t{\n\t\t\"name\": 
\"office-v1\"\n\t}\n]"
+                               },
+                               "url": {
+                                       "raw": 
"http://{{provisionerUrl}}/provisioner/v1/tenants/{{tenantIdentifier}}/applications";,
+                                       "protocol": "http",
+                                       "host": [
+                                               "{{provisionerUrl}}"
+                                       ],
+                                       "path": [
+                                               "provisioner",
+                                               "v1",
+                                               "tenants",
+                                               "{{tenantIdentifier}}",
+                                               "applications"
+                                       ]
+                               }
+                       },
+                       "response": []
+               },
+               {
+                       "name": "05.1 Create customer-v1 application",
+                       "request": {
+                               "method": "POST",
+                               "header": [
+                                       {
+                                               "key": "Authorization",
+                                               "value": "{{rootUserToken}}"
+                                       },
+                                       {
+                                               "key": "User",
+                                               "value": "{{rootUser}}"
+                                       },
+                                       {
+                                               "key": "Content-Type",
+                                               "value": "application/json"
+                                       },
+                                       {
+                                               "key": "X-Tenant-Identifier",
+                                               "value": "{{tenantIdentifier}}"
+                                       }
+                               ],
+                               "body": {
+                                       "mode": "raw",
+                                       "raw": "{\n\t\"name\": 
\"customer-v1\",\n\t\"description\": \"Customer Service\",\n\t\"vendor\": 
\"Apache Fineract\",\n\t\"homepage\": \"http://localhost:2024/customer/v1\"\n}";
+                               },
+                               "url": {
+                                       "raw": 
"http://{{provisionerUrl}}/provisioner/v1/applications";,
+                                       "protocol": "http",
+                                       "host": [
+                                               "{{provisionerUrl}}"
+                                       ],
+                                       "path": [
+                                               "provisioner",
+                                               "v1",
+                                               "applications"
+                                       ]
+                               }
+                       },
+                       "response": []
+               },
+               {
+                       "name": "05.2 Assign customer for Tenant",
+                       "request": {
+                               "method": "PUT",
+                               "header": [
+                                       {
+                                               "key": "Authorization",
+                                               "value": "{{rootUserToken}}"
+                                       },
+                                       {
+                                               "key": "User",
+                                               "value": "{{rootUser}}"
+                                       },
+                                       {
+                                               "key": "Content-Type",
+                                               "value": "application/json"
+                                       },
+                                       {
+                                               "key": "X-Tenant-Identifier",
+                                               "value": "{{tenantIdentifier}}"
+                                       }
+                               ],
+                               "body": {
+                                       "mode": "raw",
+                                       "raw": "[\n\t{\n\t\t\"name\": 
\"customer-v1\"\n\t}\n]"
+                               },
+                               "url": {
+                                       "raw": 
"http://{{provisionerUrl}}/provisioner/v1/tenants/{{tenantIdentifier}}/applications";,
+                                       "protocol": "http",
+                                       "host": [
+                                               "{{provisionerUrl}}"
+                                       ],
+                                       "path": [
+                                               "provisioner",
+                                               "v1",
+                                               "tenants",
+                                               "{{tenantIdentifier}}",
+                                               "applications"
+                                       ]
+                               }
+                       },
+                       "response": []
+               },
+               {
+                       "name": "06.1 Create accounting-v1 application",
+                       "request": {
+                               "method": "POST",
+                               "header": [
+                                       {
+                                               "key": "Authorization",
+                                               "value": "{{rootUserToken}}"
+                                       },
+                                       {
+                                               "key": "User",
+                                               "value": "{{rootUser}}"
+                                       },
+                                       {
+                                               "key": "Content-Type",
+                                               "value": "application/json"
+                                       },
+                                       {
+                                               "key": "X-Tenant-Identifier",
+                                               "value": "{{tenantIdentifier}}"
+                                       }
+                               ],
+                               "body": {
+                                       "mode": "raw",
+                                       "raw": "{\n\t\"name\": 
\"accounting-v1\",\n\t\"description\": \"Accounting Service\",\n\t\"vendor\": 
\"Apache Fineract\",\n\t\"homepage\": 
\"http://localhost:2025/accounting/v1\"\n}";
+                               },
+                               "url": {
+                                       "raw": 
"http://{{provisionerUrl}}/provisioner/v1/applications";,
+                                       "protocol": "http",
+                                       "host": [
+                                               "{{provisionerUrl}}"
+                                       ],
+                                       "path": [
+                                               "provisioner",
+                                               "v1",
+                                               "applications"
+                                       ]
+                               }
+                       },
+                       "response": []
+               },
+               {
+                       "name": "06.2 Assign accounting for Tenant",
+                       "request": {
+                               "method": "PUT",
+                               "header": [
+                                       {
+                                               "key": "Authorization",
+                                               "value": "{{rootUserToken}}"
+                                       },
+                                       {
+                                               "key": "User",
+                                               "value": "{{rootUser}}"
+                                       },
+                                       {
+                                               "key": "Content-Type",
+                                               "value": "application/json"
+                                       },
+                                       {
+                                               "key": "X-Tenant-Identifier",
+                                               "value": "{{tenantIdentifier}}"
+                                       }
+                               ],
+                               "body": {
+                                       "mode": "raw",
+                                       "raw": "[\n\t{\n\t\t\"name\": 
\"accounting-v1\"\n\t}\n]"
+                               },
+                               "url": {
+                                       "raw": 
"http://{{provisionerUrl}}/provisioner/v1/tenants/{{tenantIdentifier}}/applications";,
+                                       "protocol": "http",
+                                       "host": [
+                                               "{{provisionerUrl}}"
+                                       ],
+                                       "path": [
+                                               "provisioner",
+                                               "v1",
+                                               "tenants",
+                                               "{{tenantIdentifier}}",
+                                               "applications"
+                                       ]
+                               }
+                       },
+                       "response": []
+               },
+               {
+                       "name": "07.1 Create deposit-v1 application",
+                       "request": {
+                               "method": "POST",
+                               "header": [
+                                       {
+                                               "key": "Authorization",
+                                               "value": "{{rootUserToken}}"
+                                       },
+                                       {
+                                               "key": "User",
+                                               "value": "{{rootUser}}"
+                                       },
+                                       {
+                                               "key": "Content-Type",
+                                               "value": "application/json"
+                                       },
+                                       {
+                                               "key": "X-Tenant-Identifier",
+                                               "value": "{{tenantIdentifier}}"
+                                       }
+                               ],
+                               "body": {
+                                       "mode": "raw",
+                                       "raw": "{\n\t\"name\": 
\"deposit-v1\",\n\t\"description\": \"Deposit Management 
Service\",\n\t\"vendor\": \"Apache Fineract\",\n\t\"homepage\": 
\"http://localhost:2026/deposit/v1\"\n}";
+                               },
+                               "url": {
+                                       "raw": 
"http://{{provisionerUrl}}/provisioner/v1/applications";,
+                                       "protocol": "http",
+                                       "host": [
+                                               "{{provisionerUrl}}"
+                                       ],
+                                       "path": [
+                                               "provisioner",
+                                               "v1",
+                                               "applications"
+                                       ]
+                               }
+                       },
+                       "response": []
+               },
+               {
+                       "name": "07.2 Assign deposits for Tenant",
+                       "request": {
+                               "method": "PUT",
+                               "header": [
+                                       {
+                                               "key": "Authorization",
+                                               "value": "{{rootUserToken}}"
+                                       },
+                                       {
+                                               "key": "User",
+                                               "value": "{{rootUser}}"
+                                       },
+                                       {
+                                               "key": "Content-Type",
+                                               "value": "application/json"
+                                       },
+                                       {
+                                               "key": "X-Tenant-Identifier",
+                                               "value": "{{tenantIdentifier}}"
+                                       }
+                               ],
+                               "body": {
+                                       "mode": "raw",
+                                       "raw": "[\n\t{\n\t\t\"name\": 
\"deposit-v1\"\n\t}\n]"
+                               },
+                               "url": {
+                                       "raw": 
"http://{{provisionerUrl}}/provisioner/v1/tenants/{{tenantIdentifier}}/applications";,
+                                       "protocol": "http",
+                                       "host": [
+                                               "{{provisionerUrl}}"
+                                       ],
+                                       "path": [
+                                               "provisioner",
+                                               "v1",
+                                               "tenants",
+                                               "{{tenantIdentifier}}",
+                                               "applications"
+                                       ]
+                               }
+                       },
+                       "response": []
+               },
+               {
+                       "name": "08.1 Create Admin Role for tenant 
\"playground\"",
+                       "event": [
+                               {
+                                       "listen": "test",
+                                       "script": {
+                                               "id": 
"c64b529c-6e8a-4ef1-ab0d-a58b9499ade9",
+                                               "exec": [
+                                                       "tests[\"Status code is 
202\"] = responseCode.code === 202;",
+                                                       ""
+                                               ],
+                                               "type": "text/javascript"
+                                       }
+                               }
+                       ],
+                       "request": {
+                               "method": "POST",
+                               "header": [
+                                       {
+                                               "key": "X-Tenant-Identifier",
+                                               "value": "{{tenantIdentifier}}"
+                                       },
+                                       {
+                                               "key": "User",
+                                               "value": "{{antonyUser}}"
+                                       },
+                                       {
+                                               "key": "Authorization",
+                                               "value": "{{antonyToken}}"
+                                       },
+                                       {
+                                               "key": "Content-Type",
+                                               "value": "application/json"
+                                       }
+                               ],
+                               "body": {
+                                       "mode": "raw",
+                                       "raw": 
"{\"identifier\":\"administrator\",\"permissions\":[{\"permittableEndpointGroupIdentifier\":\"identity__v1__roles\",\"allowedOperations\":[\"READ\",\"CHANGE\",\"DELETE\"]},{\"permittableEndpointGroupIdentifier\":\"identity__v1__self\",\"allowedOperations\":[\"READ\",\"CHANGE\",\"DELETE\"]},{\"permittableEndpointGroupIdentifier\":\"office__v1__employees\",\"allowedOperations\":[\"READ\",\"CHANGE\",\"DELETE\"]},{\"permittableEndpointGroupIdentifier\":\"customer__v1__task\",\"al
 [...]
+                               },
+                               "url": {
+                                       "raw": 
"http://{{identityUrl}}/identity/v1/roles";,
+                                       "protocol": "http",
+                                       "host": [
+                                               "{{identityUrl}}"
+                                       ],
+                                       "path": [
+                                               "identity",
+                                               "v1",
+                                               "roles"
+                                       ]
+                               }
+                       },
+                       "response": []
+               },
+               {
+                       "name": "08.2 Create Admin User",
+                       "request": {
+                               "method": "POST",
+                               "header": [
+                                       {
+                                               "key": "Authorization",
+                                               "value": "{{antonyToken}}"
+                                       },
+                                       {
+                                               "key": "User",
+                                               "value": "{{antonyUser}}"
+                                       },
+                                       {
+                                               "key": "Content-Type",
+                                               "value": "application/json"
+                                       },
+                                       {
+                                               "key": "X-Tenant-Identifier",
+                                               "value": "{{tenantIdentifier}}"
+                                       }
+                               ],
+                               "body": {
+                                       "mode": "raw",
+                                       "raw": "{\n\t\"identifier\": 
\"mifos\",\n\t\"role\": \"administrator\",\n\t\"password\": \"cGFzc3dvcmQ=\"\n}"
+                               },
+                               "url": {
+                                       "raw": 
"http://{{identityUrl}}/identity/v1/users";,
+                                       "protocol": "http",
+                                       "host": [
+                                               "{{identityUrl}}"
+                                       ],
+                                       "path": [
+                                               "identity",
+                                               "v1",
+                                               "users"
+                                       ]
+                               }
+                       },
+                       "response": []
+               }
+       ]
+}
diff --git 
a/postman_scripts/Fineract-Cn-Initial-Setup-Environment.postman_environment.json
 
b/postman_scripts/Fineract-Cn-Initial-Setup-Environment.postman_environment.json
new file mode 100644
index 0000000..ee13692
--- /dev/null
+++ 
b/postman_scripts/Fineract-Cn-Initial-Setup-Environment.postman_environment.json
@@ -0,0 +1,84 @@
+{
+       "id": "91c46e16-2e81-441f-af81-349ca02d2052",
+       "name": "Fineract-Cn-Initial-Setup-Environment",
+       "values": [
+               {
+                       "key": "host",
+                       "value": "localhost",
+                       "enabled": true
+               },
+               {
+                       "key": "tenantIdentifier",
+                       "value": "playground",
+                       "enabled": true
+               },
+               {
+                       "key": "user",
+                       "value": "superuser",
+                       "enabled": true
+               },
+               {
+                       "key": "accessToken",
+                       "value": "Bearer 
eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiJzdXBlcnVzZXIiLCIvbWlmb3MuaW8vc2lnbmF0dXJlVGltZXN0YW1wIjoiMjAxNy0wNC0yNlQwN18yNl8xMyIsIi9taWZvcy5pby90b2tlbkNvbnRlbnQiOiJ7XCJ0b2tlblBlcm1pc3Npb25zXCI6W3tcInBhdGhcIjpcInBvcnRmb2xpby12MS9wcm9kdWN0cy8qL2NoYXJnZXNcIixcImFsbG93ZWRPcGVyYXRpb25zXCI6W1wiQ0hBTkdFXCJdfSx7XCJwYXRoXCI6XCJpZGVudGl0eS12MS9hcHBsaWNhdGlvbnMvKi9wZXJtaXNzaW9ucy8qL3VzZXJzL3t1c2VyaWRlbnRpZmllcn0vZW5hYmxlZFwiLFwiYWxsb3dlZE9wZXJhdGlvbnNcIjpbXCJSRUFEXCJdfSx7XCJwYXRoXCI6XCJpZGV
 [...]
+                       "enabled": true
+               },
+               {
+                       "key": "rootUser",
+                       "value": "wepemnefret",
+                       "enabled": true
+               },
+               {
+                       "key": "rootUserToken",
+                       "value": "Bearer 
eyJhbGciOiJSUzUxMiJ9.eyJhdWQiOiJwcm92aXNpb25lci12MSIsInN1YiI6IndlcGVtbmVmcmV0IiwiL2ZpbmNuLmFwYWNoZS5vcmcvcyI6IjIwMTktMDktMDRUMDZfNDNfNTIiLCIvZmluY24uYXBhY2hlLm9yZy9jIjoiUk9MRV9BRE1JTiIsImlzcyI6InN5c3RlbSIsImlhdCI6MTU2NzY5MDcxOSwiZXhwIjoxNTY3Njk0MzE5fQ.mG4Hs3IkU0_lHzazEidYU3EbVoHxmVhF3mBKWsnsLktE4PUnFjkfkP201RLypUzUTFTR4jp8ytDryOZQi-Cqku1BeRv8zQihJNFNL5khpmLnDKmelffE4BmM6t3wPsXSLke9orTL6HQEgNELcR03UhihGp_JvPYVQ5uzcSKcv1uG5U0IDZdKMAfvCdeu7uS5mV_H6tHnPjChbGcfPdB6wtk-4d7O
 [...]
+                       "enabled": true
+               },
+               {
+                       "key": "antonyUser",
+                       "value": "antony",
+                       "enabled": true
+               },
+               {
+                       "key": "antonyToken",
+                       "value": "Bearer 
eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiJhbnRvbnkiLCIvZmluY24uYXBhY2hlLm9yZy9zIjoiMjAxOS0wOS0wNVQxM18zOV80NiIsIi9maW5jbi5hcGFjaGUub3JnL2MiOiJ7XCJ0b2tlblBlcm1pc3Npb25zXCI6W3tcInBhdGhcIjpcImlkZW50aXR5LXYxL3VzZXJzL3t1c2VyaWRlbnRpZmllcn0vcGFzc3dvcmRcIixcImFsbG93ZWRPcGVyYXRpb25zXCI6W1wiQ0hBTkdFXCIsXCJSRUFEXCIsXCJERUxFVEVcIl19LHtcInBhdGhcIjpcImlkZW50aXR5LXYxL3JvbGVzLypcIixcImFsbG93ZWRPcGVyYXRpb25zXCI6W1wiQ0hBTkdFXCIsXCJSRUFEXCIsXCJERUxFVEVcIl19LHtcInBhdGhcIjpcImlkZW50aXR5LXYxL3VzZXJ
 [...]
+                       "enabled": true
+               },
+               {
+                       "key": "client_id",
+                       "value": "service-runner",
+                       "enabled": true
+               },
+               {
+                       "key": "rootUserPassword",
+                       "value": "oS/0IiAME/2unkN1momDrhAdNKOhGykYFH/mJN20",
+                       "enabled": true
+               },
+               {
+                       "key": "provisionerUrl",
+                       "value": "provisioner-ms:2020",
+                       "enabled": true
+               },
+               {
+                       "key": "identityUrl",
+                       "value": "identity-ms:2021",
+                       "enabled": true
+               },
+               {
+                       "key": "webappUrl",
+                       "value": "localhost:8888",
+                       "enabled": true
+               },
+               {
+                       "key": "accountingUrl",
+                       "value": "accounting-ms:2025",
+                       "enabled": true
+               },
+               {
+                       "key": "antonyUserPassword",
+                       "value": "dGVzdA==",
+                       "enabled": true
+               }
+       ],
+       "_postman_variable_scope": "environment",
+       "_postman_exported_at": "2019-09-05T13:50:13.901Z",
+       "_postman_exported_using": "Postman/7.5.0"
+}

Reply via email to