Skip to content

Commit 2f68291

Browse files
author
Alexander Dadyka
committed
Fix: API documentation to README.md
1 parent 55047fa commit 2f68291

File tree

1 file changed

+95
-2
lines changed

1 file changed

+95
-2
lines changed

README.md

+95-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ docker-compose exec php-fpm ./vendor/bin/phpunit --coverage-html ./storage/repor
8080
- Request URL: `http://localhost:8081/api/orders?start=0&end=2&sort_column=id&sort_type=asc`
8181
- Method: `GET`
8282
- Path: `/orders`
83-
- Request Parameters: `start, end, sort_column, sort_type`
83+
- Headers: `Accept:application/json, Content-Type:application/json`
84+
- Parameters: `start, end, sort_column, sort_type`
8485
- Status Code: `200`
8586
- Response:
8687
```json
@@ -118,7 +119,8 @@ docker-compose exec php-fpm ./vendor/bin/phpunit --coverage-html ./storage/repor
118119
- Request URL: `http://localhost:8081/api/orders`
119120
- Method: `POST`
120121
- Path: `/orders`
121-
- Request Parameters: `agency_name, rental_date, guest_count, transport_count, user_name, email, phone`
122+
- Headers: `Accept:application/json, Content-Type:application/json`
123+
- Parameters: `agency_name, rental_date, guest_count, transport_count, user_name, email, phone`
122124
- Status Code: `201`
123125
- Response:
124126
```json
@@ -143,3 +145,94 @@ docker-compose exec php-fpm ./vendor/bin/phpunit --coverage-html ./storage/repor
143145
}
144146
}
145147
```
148+
149+
### Order Details
150+
- Request URL: `http://localhost:8081/api/orders/10000011`
151+
- Method: `GET`
152+
- Path: `/orders/{id}`
153+
- Headers: `Accept:application/json, Content-Type:application/json`
154+
- Status Code: `200`
155+
- Response:
156+
```json
157+
{
158+
"data": {
159+
"id": 10000011,
160+
"agency_name": "Test Agency Name",
161+
"status": "waiting",
162+
"is_confirmed": false,
163+
"is_checked": false,
164+
"rental_date": "22-12-2023",
165+
"user_name": "Test User Name",
166+
"transport_count": 1,
167+
"guest_count": 1,
168+
"admin_note": null,
169+
"note": null,
170+
"email": "[email protected]",
171+
"phone": "71437854547",
172+
"confirmed_at": null,
173+
"created_at": "21-12-2023 12:22:33",
174+
"updated_at": "21-12-2023 12:22:33"
175+
}
176+
}
177+
```
178+
179+
### Update Order
180+
- Request URL: `http://localhost:8081/api/orders/10000011`
181+
- Method: `PUT`
182+
- Path: `/orders/{id}`
183+
- Headers: `Accept:application/json, Content-Type:application/json`
184+
- Parameters: `guest_count, transport_count, user_name, email, phone`
185+
- Status Code: `200`
186+
- Response:
187+
```json
188+
{
189+
"data": {
190+
"id": 10000011,
191+
"agency_name": "Test Agency Name",
192+
"status": "waiting",
193+
"is_confirmed": false,
194+
"is_checked": false,
195+
"rental_date": "22-12-2023",
196+
"user_name": "Test User Name",
197+
"transport_count": 1,
198+
"guest_count": 1,
199+
"admin_note": null,
200+
"note": null,
201+
"email": "[email protected]",
202+
"phone": "70000000001",
203+
"confirmed_at": null,
204+
"created_at": "21-12-2023 12:22:33",
205+
"updated_at": "21-12-2023 15:03:33"
206+
}
207+
}
208+
```
209+
210+
### Delete Order
211+
- Request URL: `http://localhost:8081/api/orders/10000011`
212+
- Method: `DELETE`
213+
- Path: `/orders/{id}`
214+
- Headers: `Accept:application/json, Content-Type:application/json`
215+
- Status Code: `200`
216+
- Response:
217+
```json
218+
{
219+
"data": {
220+
"id": 10000011,
221+
"agency_name": "Test Agency Name",
222+
"status": "waiting",
223+
"is_confirmed": false,
224+
"is_checked": false,
225+
"rental_date": "22-12-2023",
226+
"user_name": "Test User Name",
227+
"transport_count": 1,
228+
"guest_count": 1,
229+
"admin_note": null,
230+
"note": null,
231+
"email": "[email protected]",
232+
"phone": "70000000001",
233+
"confirmed_at": null,
234+
"created_at": "21-12-2023 12:22:33",
235+
"updated_at": "21-12-2023 15:13:30"
236+
}
237+
}
238+
```

0 commit comments

Comments
 (0)