Skip to content

Commit

Permalink
[#1] Update kios documentation v3
Browse files Browse the repository at this point in the history
  • Loading branch information
I Putu Mahendra Juniartha committed Dec 7, 2020
1 parent 8e5159d commit b2beafc
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 49 deletions.
Binary file modified doc/kios-layer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 34 additions & 49 deletions doc/kios.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ POST /kios
## Database
![](./kios-layer.png)

For add, you need get branch_code from branches tables
For add, you need get branch_id from branches tables

### Header
Key | Value
Expand All @@ -28,15 +28,15 @@ Name | Type | Example Value
--- | --- | ---
kios_name | string | mandala
address | string | jl. bekasi timur raya no. 159 A
branch_code | string | mandala
branch_id | string | 0e38acf5-ac53-11e9-91ea-560001ead144

```
{
"kios_name": "mandala",
"address": "jl. bekasi timur raya no. 159 A",
"branches": [
{
"branch_code": "02629"
"branch_id": "0e38acf5-ac53-11e9-91ea-560001ead144"
}
]
}
Expand All @@ -47,7 +47,7 @@ HTTP Code | Status | Description
--- | --- | ---
400 | Bad Request | bad request payload
404 | Not Found | branch not found in database
403 | Forbidden | branch_code is not owned by user login
403 | Forbidden | branch_id is not owned by user login
500 | Internal Server Error | some un-handle error in server
201 | Created | add data kios
```
Expand All @@ -68,7 +68,7 @@ HTTP Code | Status | Description
"address": jl. "bekasi timur raya no. 159 A",
"branches": [
{
"branch_code": "02629"
"branch_id": "0e38acf5-ac53-11e9-91ea-560001ead144"
}
]
}
Expand All @@ -80,7 +80,7 @@ HTTP Code | Status | Description
#### Validation
- kios_name : required and not empty
- address : required and not empty
- branch_code : required and not empty, owned by user login
- branch_id : required and not empty, owned by user login

### Scenario Test

Expand Down Expand Up @@ -184,7 +184,7 @@ Request Payload :
```
{
"kios_name": "mandala",
"address": "jl. bekasi timur raya no. 159 A",
"address": "jl. bekasi timur raya no. 159 A"
}
```

Expand All @@ -194,7 +194,7 @@ Response Payload:
```
{
"status_code": "cdc-400",
"status_message": "branch_code is required",
"status_message": "branch_id is required",
"data": null
}
```
Expand All @@ -206,7 +206,7 @@ Request Payload :
{
"kios_name": "mandala",
"address": "jl. bekasi timur raya no. 159 A",
"branch_code": ""
"branch_id": ""
}
```

Expand All @@ -216,7 +216,7 @@ Response Payload :
```
{
"status_code": "cdc-400",
"status_message": "branch_code is empty",
"status_message": "branch_id is empty",
"data": null
}
```
Expand All @@ -228,7 +228,7 @@ Request Payload :
{
"kios_name": "mandala",
"address": "jl. bekasi timur raya no. 159 A",
"branch_code": "asal"
"branch_id": "asal"
}
```

Expand All @@ -238,7 +238,7 @@ Response Payload:
```
{
"status_code": "cdc-404",
"status_message": "branch_code is not found",
"status_message": "branch_id is not found",
"data": null
}
```
Expand All @@ -250,7 +250,7 @@ Request Payload :
{
"kios_name": "mandala",
"address": "jl. bekasi timur raya no. 159 A",
"branch_code": "0001"
"branch_id": "0001"
}
```

Expand All @@ -260,7 +260,7 @@ Response Payload :
```
{
"status_code": "cdc-403",
"status_message": "branch_code is not owned by user login",
"status_message": "branch_id is not owned by user login",
"data": null
}
```
Expand All @@ -273,7 +273,7 @@ Request Payload :
"id": 1,
"kios_name": "mandala",
"address": "jl. bekasi timur raya no. 159 A",
"branch_code": "02629"
"branch_id": "0e38acf5-ac53-11e9-91ea-560001ead144"
}
```

Expand All @@ -287,10 +287,10 @@ Response Payload :
"data": {
"id": 1,
"kios_name": "mandala",
"address": "jl. bekasi timur raya no. 159 A"
"address": "jl. bekasi timur raya no. 159 A",
"branches": [
{
"branch_code": "02629"
"branch_id": "0e38acf5-ac53-11e9-91ea-560001ead144"
}
]
}
Expand All @@ -314,13 +314,13 @@ Name | Type | Example Value
--- | --- | ---
kios_name | string | mandala
address | string | bekasi timur raya no. 159 A
branch_code | string | 02629
branch_id | string | 0e38acf5-ac53-11e9-91ea-560001ead144

```
{
"kios_name": "mandala",
"address": "bekasi timur raya no. 159 A",
"branch_code": "02629"
"branch_id": "0e38acf5-ac53-11e9-91ea-560001ead144"
}
```

Expand All @@ -329,7 +329,7 @@ HTTP Code | Status | Description
--- | --- | ---
400 | Bad Request | Bad request payload
404 | Not Found | Kios not found in database
403 | Forbidden | branch_code is not owned by user login
403 | Forbidden | branch_id is not owned by user login
500 | Internal Server Error | some un-handle error in server
200 | OK | OK
```
Expand All @@ -350,7 +350,7 @@ HTTP Code | Status | Description
"address": "jl. k. h. moch mansyur no. 32 jembatan 5",
"branches": [
{
"branch_code": "02629"
"branch_id": "0e38acf5-ac53-11e9-91ea-560001ead144"
}
]
}
Expand All @@ -362,7 +362,7 @@ HTTP Code | Status | Description
#### Validation
- kios_name : not empty
- address : not empty
- branch_code : required and not empty, owned by user login
- branch_id : required and not empty, owned by user login

### Scenario Test

Expand Down Expand Up @@ -467,7 +467,7 @@ Request Payload :
{
"kios_name": "kalimantan",
"address": "jl. k. h. moch mansyur no. 32 jembatan 5",
"branch_code": ""
"branch_id": ""
}
```

Expand All @@ -477,7 +477,7 @@ Response Payload :
```
{
"status_code": "cdc-400",
"status_message": "branch_code is empty",
"status_message": "branch_id is empty",
"data": null
}
```
Expand All @@ -489,7 +489,7 @@ Request Payload :
{
"kios_name": "kalimantan",
"address": "jl. k. h. moch mansyur no. 32 jembatan 5",
"branch_code": "asal"
"branch_id": "asal"
}
```

Expand All @@ -499,7 +499,7 @@ Response Payload:
```
{
"status_code": "cdc-404",
"status_message": "branch_code not found",
"status_message": "branch_id not found",
"data": null
}
```
Expand All @@ -511,7 +511,7 @@ Request Payload :
{
"kios_name": "kalimantan",
"address": "jl. k. h. moch mansyur no. 32 jembatan 5",
"branch_code": "0001"
"branch_id": "0001"
}
```

Expand All @@ -521,7 +521,7 @@ Response Payload:
```
{
"status_code": "cdc-403",
"status_message": "branch_code not owned by user login",
"status_message": "branch_id not owned by user login",
"data": null
}
```
Expand All @@ -533,7 +533,7 @@ Request Payload :
{
"kios_name": "kalimantan",
"address": "bekasi timur raya no. 159 A",
"branch_code": "02629"
"branch_id": "0e38acf5-ac53-11e9-91ea-560001ead144"
}
```

Expand All @@ -550,7 +550,7 @@ Response Payload :
"address": "bekasi timur raya no. 159 A",
"branches": [
{
"branch_code": "02629"
"branch_id": "0e38acf5-ac53-11e9-91ea-560001ead144"
}
]
}
Expand All @@ -564,7 +564,7 @@ Request Payload :
{
"kios_name": "kalimantan",
"address": "jl. k. h. moch mansyur no. 32 jembatan 5",
"branch_code": "02629"
"branch_id": "0e38acf5-ac53-11e9-91ea-560001ead144"
}
```

Expand All @@ -581,7 +581,7 @@ Response Payload :
"address": "jl. k. h. moch mansyur no. 32 jembatan 5",
"branches": [
{
"branch_code": "02629"
"branch_id": "0e38acf5-ac53-11e9-91ea-560001ead144"
}
]
}
Expand All @@ -603,18 +603,10 @@ Email | [email protected]
### Response Payloads
HTTP Code | Status | Description
--- | --- | ---
400 | Bad Request | Bad request payload
404 | Not Found | Kios not found in database
403 | Forbidden | kios_id not owned by user login
500 | Internal Server Error | some un-handle error in server
200 | OK | OK
```
{
"status_code": "CDC-400",
"status_message": "Bad Request",
"data": null
}
```

```
{
Expand All @@ -626,7 +618,7 @@ HTTP Code | Status | Description
"address": jl. "bekasi timur raya no. 159 A",
"branches": [
{
"branch_code": "02629"
"branch_id": "0e38acf5-ac53-11e9-91ea-560001ead144"
}
]
}
Expand Down Expand Up @@ -668,7 +660,7 @@ Response Payload :
"address": "jl. k. h. moch mansyur no. 32 jembatan 5",
"branches": [
{
"branch_code": "06502"
"branch_id": "0e38ac51-ac53-11e9-91ea-560001ead144"
}
]
}
Expand All @@ -695,13 +687,6 @@ HTTP Code | Status | Description
500 | Internal Server Error | some un-handle error in server
204 | No Content | Delete data kios

```
{
"status_code": "CDC-204",
"status_message": "No Content",
}
```

### Logic

#### Validation
Expand Down

0 comments on commit b2beafc

Please sign in to comment.