65 lines
1.5 KiB
Plaintext
65 lines
1.5 KiB
Plaintext
# 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": "10:00",
|
|
"is_repeating": false,
|
|
"requires_confirmation": false
|
|
}
|
|
HTTP 200
|
|
[Asserts]
|
|
jsonpath "$" count == 1
|
|
|
|
|
|
GET http://localhost/wordpress/wp-json/reservations/v1/object/{{object_id}}/timetable/reservation/occupancy?date=2025-08-31
|
|
HTTP 200
|
|
[Asserts]
|
|
jsonpath "$.occupancy" count == 4
|
|
|
|
jsonpath "$.occupancy[0]" == 0
|
|
jsonpath "$.occupancy[1]" == 0
|
|
jsonpath "$.occupancy[2]" == 0
|
|
jsonpath "$.occupancy[3]" == 0
|
|
|
|
POST http://localhost/wordpress/wp-json/reservations/v1/object/{{object_id}}/timetable/reservation
|
|
{
|
|
"timetable_id": {{object_id}},
|
|
"date": "2025-08-31",
|
|
"email": "test@test",
|
|
"full_name": "Test Test",
|
|
"phone": "123 456 789",
|
|
"reservations": [
|
|
{
|
|
"start_block_idx": 16,
|
|
"num_blocks": 2
|
|
}
|
|
]
|
|
}
|
|
HTTP 200
|
|
|
|
GET http://localhost/wordpress/wp-json/reservations/v1/object/{{object_id}}/timetable/reservation/occupancy?date=2025-08-31
|
|
HTTP 200
|
|
[Asserts]
|
|
jsonpath "$.occupancy" count == 4
|
|
|
|
jsonpath "$.occupancy[0]" == 1
|
|
jsonpath "$.occupancy[1]" == 1
|
|
jsonpath "$.occupancy[2]" == 0
|
|
jsonpath "$.occupancy[3]" == 0
|