Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:CodeTanzania/ewea into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMaruchu committed Dec 4, 2019
2 parents 6879dee + c8d9f50 commit 740b835
Show file tree
Hide file tree
Showing 3 changed files with 1,845 additions and 1 deletion.
17 changes: 16 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2193,6 +2193,7 @@ HTTP/1.1 200 Success
| Name | Type | Description |
| :----------: | :----: | :--------------------------------------------------------------------------------------------------------------: |
| \_id | String | Unique universal identifier of this event function. |
| type | String | Human readable type of a event function. |
| name | Object | Human-translatable-readable name for the event function. |
| abbreviation | Object | Human-translatable-readable abbreviation for the name of the event function. |
| description | Object | Human-translatable-readable description for the event function. |
Expand All @@ -2210,6 +2211,7 @@ To create a new event function, send a `POST` request to `https://api.ewea.io/v1
| Name | Type | Description | Required |
| :---------: | :----: | :--------------------------------------------------------------------------------: | :------: |
| code | String | Unique human-readable given code of this event function. | false |
| type | String | Human readable type of a event function. | true |
| name | Object | Human-translatable-readable name for the event function. | true |
| description | Object | Human-translatable-readable description for the event function. | false |
| color | String | A color code(in hexadecimal format) used to differentiate event function visually. | false |
Expand All @@ -2223,6 +2225,7 @@ curl --request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <apiKey>' \
--data '{
"type": "Flood"
"code": "DBM",
"name": { "en": "Dead Bodies Management" },
"color": "#F9C5A7"
Expand All @@ -2236,6 +2239,7 @@ The response will be a `JSON object` with the standard event group attributes:
| Name | Type | Description |
| :----------: | :----: | :--------------------------------------------------------------------------------------------------------------: |
| \_id | String | Unique universal identifier of this event function. |
| type | String | Human readable type of a event function. |
| name | Object | Human-translatable-readable name for the event function. |
| abbreviation | Object | Human-translatable-readable abbreviation for the name of the event function. |
| description | Object | Human-translatable-readable description for the event function. |
Expand All @@ -2250,6 +2254,7 @@ The response will be a `JSON object` with the standard event group attributes:
HTTP/1.1 201 Success
{
"_id": "5ddbbc871283e3131b2d41f4",
"type": "Flood",
"name": { "en": "Dead Bodies Management" },
"abbreviation": { "en": "DBM" },
"description": { "en": "" },
Expand Down Expand Up @@ -2280,6 +2285,7 @@ The response will be a `JSON object` with the standard event function attributes
| Name | Type | Description |
| :----------: | :----: | :--------------------------------------------------------------------------------------------------------------: |
| \_id | String | Unique universal identifier of this event function. |
| type | String | Human readable type of a event function. |
| name | Object | Human-translatable-readable name for the event function. |
| abbreviation | Object | Human-translatable-readable abbreviation for the name of the event function. |
| description | Object | Human-translatable-readable description for the event function. |
Expand All @@ -2294,6 +2300,7 @@ The response will be a `JSON object` with the standard event function attributes
HTTP/1.1 200 Success
{
"_id": "5ddbbc871283e3131b2d41f4",
"type": "Flood",
"code": "DBM",
"name": { "en": "Dead Bodies Management" },
"description": { "en": "" },
Expand All @@ -2312,6 +2319,7 @@ To update existing event function, send a `PATCH` request to `https://api.ewea.i

| Name | Type | Description | Required |
| :---------: | :----: | :-------------------------------------------------------------: | :------: |
| type | String | Human readable type of a event function. | true |
| name | Object | Human-translatable-readable name for the event function. | true |
| description | Object | Human-translatable-readable description for the event function. | false |

Expand All @@ -2324,6 +2332,7 @@ curl --request PATCH \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <apiKey>' \
--data '{
"type": "Flood",
"name": { "en": "Dead Bodies Management" },
"description": { "en": "" },
}'
Expand All @@ -2336,6 +2345,7 @@ The response will be a `JSON object` with the standard event function attributes
| Name | Type | Description |
| :----------: | :----: | :--------------------------------------------------------------------------------------------------------------: |
| \_id | String | Unique universal identifier of this event function. |
| type | String | Human readable type of a event function. |
| name | Object | Human-translatable-readable name for the event function. |
| abbreviation | Object | Human-translatable-readable abbreviation for the name of the event function. |
| description | Object | Human-translatable-readable description for the event function. |
Expand All @@ -2351,6 +2361,7 @@ HTTP/1.1 200 Success
{
"_id": "5ddbbc871283e3131b2d41f4",
"code": "DBM",
"type": "Flood",
"name": { "en": "Dead Bodies Management" },
"abbreviation": { "en": "DBM" },
"description": { "en": "" },
Expand Down Expand Up @@ -2380,6 +2391,7 @@ The response will be a `JSON object` with the standard event function attributes
| Name | Type | Description |
| :----------: | :----: | :--------------------------------------------------------------------------------------------------------------: |
| \_id | String | Unique universal identifier of this event function. |
| type | String | Human readable type of a event function. |
| name | Object | Human-translatable-readable name for the event function. |
| abbreviation | Object | Human-translatable-readable abbreviation for the name of the event function. |
| description | Object | Human-translatable-readable description for the event function. |
Expand All @@ -2395,6 +2407,7 @@ HTTP/1.1 200 Success
{
"_id": "5ddbbc871283e3131b2d41f4",
"code": "DBM",
"type": "Flood",
"name": { "en": "Dead Bodies Management" },
"abbreviation": { "en": "DBM" },
"description": { "en": "" },
Expand All @@ -2404,7 +2417,7 @@ HTTP/1.1 200 Success
}
```

### List All EventFuntion
### List All EventFunction

To list all event functions, send a `GET` request to `https://api.ewea.io/v1/predefines/`.

Expand All @@ -2425,6 +2438,7 @@ The response will be a `JSON object` with a `data key`. The values in the `data
| :----------: | :----: | :--------------------------------------------------------------------------------------------------------------: |
| \_id | String | Unique universal identifier of this event function. |
| name | Object | Human-translatable-readable name for the event function. |
| type | String | Human readable type of a event function. |
| abbreviation | Object | Human-translatable-readable abbreviation for the name of the event function. |
| description | Object | Human-translatable-readable description for the event function. |
| code | String | Unique human-readable given code of this event function. |
Expand All @@ -2439,6 +2453,7 @@ HTTP/1.1 200 Success
{
"data": [{
"_id": "5ddbbc871283e3131b2d41f4",
"type": "Flood",
"name": { "en": "Dead Bodies Management" },
"abbreviation": { "en": "DBM" },
"description": { "en": "" },
Expand Down
Binary file modified docs/domain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 740b835

Please sign in to comment.