-
GET
api/planes- request parameters: None
- request body: None
- Returns all the planes
[ {"planeId":1,"type":"local","rows":15,"columns":4}, {"planeId":2,"type":"regional","rows":20,"columns":5}, {"planeId":3,"type":"international","rows":25,"columns":6} ] -
GET
/api/seats/:planeId- request parameters: None
- request body: None
- Returns the list of all seats of a specific plane
[ {"seatId":310,"status":"occupied","row":1,"position":"A","planeId":1,"userId":2}, {"seatId":311,"status":"available","row":1,"position":"B","planeId":1,"userId":null}, ... ] -
PUT
/api/seats/bookseats/:planeId- Attempts to book requested seats by an authenticated user, if one of the requested seats was booked in the meantime it return the list of seats of the plane, with the seats alredy booked with
status: alreadyBookedand code 500, otherwise correctly books seats and returns code 200
- Attempts to book requested seats by an authenticated user, if one of the requested seats was booked in the meantime it return the list of seats of the plane, with the seats alredy booked with
-
request parameters: None
-
request body:
[ {"seatId":311,"status":"occupied"}, ] -
response body(in case of already booked seats):
[ {"seatId":311,"status":"occupied"}, ] -
PUT
/api/seats/cancelbooking/:planeId- Cancels the booking of an authenticated user for a specific plane given by
planeId - request parameters: None
- request body:
{ "planeId":1 }- response body:
"successfuly canceled booking" - Cancels the booking of an authenticated user for a specific plane given by
-
POST
/api/sessions -
authenticate the user who is trying to login
-
Request body: credentials of the user who is trying to login
{
"username": "username",
"password": "password"
}response body:
{
"id": 1,
"username": "john.doe@polito.it",
"name": "John"
}- GET
/api/sessions/current - check if current user is logged in and get her data
- Response body: authenticated user
{
"id": 1,
"username": "john.doe@polito.it",
"name": "John"
}- DELETE
/api/sessions/current - logout current user
- Request body: None
- Response body: None
- Table
users- contains users (id, email, name, hash, salt) - Table
seats- contains the list of seats (seatId, status, row, position, planeId, userId) - Table
planes- contains the list of planes (planeId, type) - Table
planeTypes- contains info about plane type (typeId, rows, columns)
- Route
/: initial page while not logged in, can see the list of planes - Route
/booking/:planeId: shows the grid representation of the seats on the place specified byplaneId, if logged in also shows the possibility to book the seats or cancel an existing booking - Route
/login: allows user to login
MainLayout(inPageLayout.jsx): holds the list of planesSeatsLayout(inPageLayout.jsx): holds all minor components for the seats layout and booking componentsSeatGrid(inPlanesLibrary.jsx): used to show the grid of available seatsBookingForm(inBookingForm.jsx): contains the components for the auto-assign of requested seats and to confirm bookingBooking(inBookingForm.jsx): shows that user already has a booking and allows to cancel it
- matteo.cicilloni@polito.it, password
- laura.armando@polito.it, password
- testuser@polito.it, password
- mario.rossi@polito.it, password
