As of June 1st, the project is completed. Some examples from the application can be seen below.
Let's buy the seat at first row, first column, which is available, by sending a post request to /purchase endpoint. If transaction is succesful, it returns the seat and the price with 200 OK Http response:
Update: now it also returns with a token, which will be used for returning tickets later.
Let's try to buy same seat again, and it returns a 400 bad request with an error "The ticket has been already purchased!"
This time, let try to buy 15th column, which is out of bounds. It returns a 400 bad request with an error "The number of a row of a column is out of bounds!"
In our cinema, first 4 rows are expensive(10) and the rest is cheaper(8). Let's buy a cheaper ticket:
Lastly, when we reach the /seats endpoint again, we can see that first seat is not listed anymore, because it's been purchased at the second example.
Now we have /return endpoint and we are able to return the ticket by using token provided during purchase:
If we try to use same token again, it returns a "wrong token" exception, because the token is not a valid one anymore.
/stats endpoint provides current statistics and http response 200, if the correct password provided:
If the correct password is not provided, it returns an error message and http response 401 unauthorised:
All the project-related topics and implementations are completed. Green bars indicate completed topics.