Skip to content

Commit

Permalink
[#8] update user documentation on edit
Browse files Browse the repository at this point in the history
  • Loading branch information
vdennis committed Dec 18, 2020
1 parent 62a58e2 commit 3c9b3c2
Showing 1 changed file with 83 additions and 27 deletions.
110 changes: 83 additions & 27 deletions doc/users.md
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,8 @@ Response Payload
Request Payload
```
{
"type_akses": 1
"type_akses": 1,
"company_id": ""
}
```

Expand All @@ -1039,7 +1040,7 @@ Response Payload
```
{
"status_code": "cdc-400",
"status_message": "company_id is required",
"status_message": "company_id is empty",
"data": null
}
```
Expand All @@ -1050,17 +1051,17 @@ Request Payload
```
{
"type_akses": 1,
"company_id": ""
"company_id": "test"
}
```

Response HTTP Status Code : 400
Response HTTP Status Code : 404

Response Payload
```
{
"status_code": "cdc-400",
"status_message": "company_id is empty",
"status_code": "cdc-404",
"status_message": "company_id not found in companies",
"data": null
}
```
Expand All @@ -1070,18 +1071,18 @@ Response Payload
Request Payload
```
{
"type_akses": 1,
"company_id": "test"
"type_akses": 2,
"company_id": "5fb5df66-5f80-416d-a055-401bcf944ef7"
}
```

Response HTTP Status Code : 404
Response HTTP Status Code : 400

Response Payload
```
{
"status_code": "cdc-404",
"status_message": "company_id not found in companies",
"status_code": "cdc-400",
"status_message": "region_id is required because type_akses edited from 1",
"data": null
}
```
Expand All @@ -1092,7 +1093,8 @@ Request Payload
```
{
"type_akses": 2,
"company_id": "5fb5df66-5f80-416d-a055-401bcf944ef7"
"company_id": "5fb5df66-5f80-416d-a055-401bcf944ef7",
"region_id": ""
}
```

Expand All @@ -1102,7 +1104,7 @@ Response Payload
```
{
"status_code": "cdc-400",
"status_message": "region_id is required",
"status_message": "region_id is empty",
"data": null
}
```
Expand All @@ -1114,17 +1116,17 @@ Request Payload
{
"type_akses": 2,
"company_id": "5fb5df66-5f80-416d-a055-401bcf944ef7",
"region_id": ""
"region_id": "test"
}
```

Response HTTP Status Code : 400
Response HTTP Status Code : 404

Response Payload
```
{
"status_code": "cdc-400",
"status_message": "region_id is empty",
"status_code": "cdc-404",
"status_message": "region_id not found in regions",
"data": null
}
```
Expand All @@ -1136,7 +1138,7 @@ Request Payload
{
"type_akses": 2,
"company_id": "5fb5df66-5f80-416d-a055-401bcf944ef7",
"region_id": "test"
"region_id": "5fb5df66-5f80-416d-a055-401bcf944ef7"
}
```

Expand All @@ -1146,7 +1148,7 @@ Response Payload
```
{
"status_code": "cdc-404",
"status_message": "region_id not found in regions",
"status_message": "region_id doesnt belong to company_id",
"data": null
}
```
Expand All @@ -1167,7 +1169,7 @@ Response Payload
```
{
"status_code": "cdc-400",
"status_message": "branch_id is required",
"status_message": "branch_id is required because type_akses edited from 1 or 2",
"data": null
}
```
Expand Down Expand Up @@ -1218,12 +1220,34 @@ Response Payload

#### Case : Negative Case 14

Request Payload
```
{
"type_akses": 3,
"company_id": "5fb5df66-5f80-416d-a055-401bcf944ef7",
"branch_id" : "5fb5df66-5f80-416d-a055-401bcf944ef7"
}
```

Response HTTP Status Code : 404

Response Payload
```
{
"status_code": "cdc-404",
"status_message": "branch_id doesnt belong to company_id",
"data": null
}
```

#### Case : Negative Case 15

Request Payload
```
{
"type_akses": 4,
"company_id": "5fb5df66-5f80-416d-a055-401bcf944ef7",
"branch_id" : "test"
"branch_id" : "5fb5e437-69dc-4eb6-8f8c-4022cf944ef7"
}
```

Expand All @@ -1233,19 +1257,19 @@ Response Payload
```
{
"status_code": "cdc-400",
"status_message": "kios_id is required",
"status_message": "kios_id is required because type_akses edited from 1 or 2 or 3",
"data": null
}
```

#### Case : Negative Case 15
#### Case : Negative Case 16

Request Payload
```
{
"type_akses": 4,
"company_id": "5fb5df66-5f80-416d-a055-401bcf944ef7",
"branch_id" : "test",
"branch_id" : "5fb5e437-69dc-4eb6-8f8c-4022cf944ef7",
"kios_id" : ""
}
```
Expand All @@ -1261,14 +1285,14 @@ Response Payload
}
```

#### Case : Negative Case 16
#### Case : Negative Case 17

Request Payload
```
{
"type_akses": 4,
"company_id": "5fb5df66-5f80-416d-a055-401bcf944ef7",
"branch_id" : "test",
"branch_id" : "5fb5e437-69dc-4eb6-8f8c-4022cf944ef7",
"kios_id" : "test"
}
```
Expand All @@ -1284,6 +1308,29 @@ Response Payload
}
```

#### Case : Negative Case 18

Request Payload
```
{
"type_akses": 4,
"company_id": "5fb5df66-5f80-416d-a055-401bcf944ef7",
"branch_id" : "5fb5e437-69dc-4eb6-8f8c-4022cf944ef7",
"kios_id" : "5fb5df66-5f80-416d-a055-401bcf944ef7"
}
```

Response HTTP Status Code : 404

Response Payload
```
{
"status_code": "cdc-404",
"status_message": "kios_id doesnt belong to branch_id",
"data": null
}
```

#### Case : Positive Case 1

Request Payload :
Expand Down Expand Up @@ -1459,6 +1506,7 @@ HTTP Code | Status | Description
--- | --- | ---
404 | Not Found | user not found in database
500 | Internal Server Error | some un-handle error in server
403 | Forbidden | user not owned by user login
200 | OK | OK

```
Expand Down Expand Up @@ -1508,6 +1556,14 @@ Response Payload :
}
```

```
{
"status_code": "cdc-403",
"status_message": "user not owned by user login",
"data": null
}
```

#### Case : Positive Case

Response HTTP Status Code : 200
Expand Down Expand Up @@ -1546,7 +1602,7 @@ Content-Type | application/json
Accept | application/json
Email | [email protected]

### Request Param
### Param Query
GET /users?keyword=dennis&page=1&limit=20&order=users.id&sort=desc&type_akses=4&company_id=5fb5df66-5f80-416d-a055-401bcf944ef7&region_id=5fb5e66d-e47c-47fd-b4bf-4064cf944ef7&branch_id=5fb5e437-69dc-4eb6-8f8c-4022cf944ef7&kios_id=5fb5e626-65ac-473d-af2c-3ff2cf944ef7

Name | Example Value | Description
Expand Down

0 comments on commit 3c9b3c2

Please sign in to comment.