start the microservice with: npm start run the test suite with: npm test
- For production environment: Database: Business Collection: companies
- For testing environment: Database: BusinessTest Collection: companies
Create a new company. Example post request body:
{
"displayName": "Xara",
"workspaces": [
{
"displayName": "XaraLondon",
"users": [
{"email": "[email protected]", "role": "admin"},
{"email": "[email protected]", "role": "basic"}
]
},
{
"displayName": "XaraBerlin",
"users": [
{"email": "[email protected]", "role": "admin"},
{"email": "[email protected]", "role": "basic"}
]
}
]
}
Update an existing company. Example patch request body:
{
"displayName": "Xara",
"workspaces": [
{
"displayName": "XaraLondonNew",
"users": [
{"email": "[email protected]", "role": "admin"},
]
},
{
"displayName": "XaraBerlinOld",
"users": [
{"email": "[email protected]", "role": "admin"},
{"email": "[email protected]", "role": "basic"},
{"email": "[email protected]", "role": "basic"}
]
}
]
}
Create a workspace within a specific company. Example post request body:
{
"displayName": "XaraAthens",
"users": [
{"email": "[email protected]", "role": "admin"},
{"email": "[email protected]", "role": "basic"}
]
}
Update a specific workspace within a specific company. Example patch request body:
{
"id": "b8e6b760-f75c-11e8-a201-93dd10335524",
"displayName": "XaraAthensNew",
"users": [
{"email": "[email protected]", "role": "admin"},
]
}
Create a new user to a specific workspace in a company. Example post request body:
{
"workspaceName": "xaraathens",
"user":
{
"email": "[email protected]",
"role": "admin"
}
}
Remove a user from a specific workspace within a company. Example delete reqest body:
{
"workspaceName": "xaraathens",
"userEmail": "[email protected]"
}