A simple ticket booking system for a movie theater with a 9x9 seating arrangement. Providing functionalities such as viewing available seats, purchasing a seat, returning a purchased seat, and viewing statistics of the room, all of which are exposed as RESTful APIs.
POST
/purchase
name type data type description row required int from 1 to 9 column required int from 1 to 9
{
"row": int,
"column": int
}
http://localhost:28852/purchase
Code Description 200 OK
{
"token": uuid
"ticket": {
"row": int
"column": int
"price": int
}
}
POST
/return
{
"token": "uuid"
}
Code Description 200 OK 400 Bad Request
When status 200:
{
"returned_ticket": {
"row": int,
"column": int,
"price": int
}
}
When status 400:
{
"error": "Wrong token!"
}
GET
/stats?password=super_secret
Key Value password super_secret
Code Description 200 OK 401 Unauthorized
When status 200:
{
"current_income": int,
"number_of_available_seats": int,
"number_of_purchased_tickets": int
}
When status 401:
{
"error": "The password is wrong!"
}