50 lines
1.2 KiB
Plaintext
50 lines
1.2 KiB
Plaintext
|
|
# If available times are created properly
|
||
|
|
#
|
||
|
|
# Create object with timetable
|
||
|
|
POST http://localhost/wordpress/wp-json/reservations/v1/object
|
||
|
|
{
|
||
|
|
"name": "TestObject1",
|
||
|
|
"timetable": {
|
||
|
|
"block_len": 30,
|
||
|
|
"block_capacity": 1
|
||
|
|
}
|
||
|
|
}
|
||
|
|
HTTP 200
|
||
|
|
[Captures]
|
||
|
|
object_id: jsonpath "$[0]"
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
POST http://localhost/wordpress/wp-json/reservations/v1/object/{{object_id}}/timetable/available
|
||
|
|
{
|
||
|
|
"timetable_id": {{object_id}},
|
||
|
|
"first_date": "2025-08-31",
|
||
|
|
"start": "8:00",
|
||
|
|
"end": "16:00",
|
||
|
|
"is_repeating": true,
|
||
|
|
"repeat_period": 7,
|
||
|
|
"repeat_times": 0,
|
||
|
|
"monday": true,
|
||
|
|
"tuesday": false,
|
||
|
|
"wednesday": true,
|
||
|
|
"thursday": false,
|
||
|
|
"friday": true,
|
||
|
|
"saturday": false,
|
||
|
|
"sunday": true,
|
||
|
|
"requires_confirmation": false
|
||
|
|
}
|
||
|
|
HTTP 200
|
||
|
|
[Asserts]
|
||
|
|
jsonpath "$" count == 4
|
||
|
|
|
||
|
|
GET http://localhost/wordpress/wp-json/reservations/v1/object/{{object_id}}/timetable/available
|
||
|
|
HTTP 200
|
||
|
|
[Asserts]
|
||
|
|
jsonpath "$[0].first_date" == "2025-09-01"
|
||
|
|
jsonpath "$[1].first_date" == "2025-09-03"
|
||
|
|
jsonpath "$[2].first_date" == "2025-09-05"
|
||
|
|
jsonpath "$[3].first_date" == "2025-08-31"
|
||
|
|
|
||
|
|
DELETE http://localhost/wordpress/wp-json/reservations/v1/object/{{object_id}}
|
||
|
|
HTTP 200
|