Implement a ticket reservation system for movies. The interactions with the system should be http/json based.
System should accept a json with following structure to be able to register a movie before any reservation can happen.
{
"imdbId": "tt0111161",
"availableSeats": 100,
"screenId": "screen_123456"
}
Where:
imdbId
is IMDB movie identifieravailableSeats
the total seats available for this moviescreenId
is an externally managed identifier of information when and where the movie is screened.
System should allow to reserve a seat for the movie. It should consume a request with following json to reserve a single seat for the movie.
{
"imdbId": "tt0111161",
"screenId": "screen_123456"
}
Where:
imdbId
is IMDB movie identifierscreenId
is an externally managed identifier of information when and where the movie is screened.
System should allow to see how many seats are reserved for a movie as well as the movie title.
It should consume a request with imdbId
and screenId
and return following response:
{
"imdbId": "tt0111161",
"screenId": "screen_123456",
"movieTitle": "The Shawshank Redemption",
"availableSeats": 100,
"reservedSeats": 50
}
Where:
imdbId
is IMDB movie identifierscreenId
is an externally managed identifier of information when and where the movie is screened.movieTitle
is the title of the movieavailableSeats
the total seats available for this moviereservedSeats
the total number of reserved seats for a movie and screen.