Bookings

Bookings for hotel rooms. There can be only one room for a given booking.

get

Returns all bookings present in the database, including those done in the past.

post

Creates a new booking if such operation is possible, i.e. no other bookings overlap with the new one.

delete

Delete the booking. This can be only done if the booking is to happen in the future, bookings in the past are only deleted when the given room reserved is deleted.

get

Retrieve booking with the given database identifier.

get

Calculate discount for the given booking.

get

Return all bookings for the given user. It is also possible to specify a date range to which the bookings should be reserved.

Users

All users of the system, including administrators.

get

Return all users registered in this system, including administrators.

get

Return user with the given id if such one exists.

get

Return user with the given email if such one exists. It is guaranteed that one email address can belong to at most one user.

post

Authenticate user using his email address and password. Returned value is either "true" or "false".

get

List all the users which have at least one room reserved. It is also possible to specify date range in by which we wish to reduce the search.

Hotels

get

Return all hotels present in the database.

get

Return hotel with the given id if such one exists.

delete

Delete hotel with the given id if such one exists.

put

Create a new hotel if the input data represent a valid hotel.

get

Returns a collection of Room for a given hotel (specified by the route parameter {id}).

get

Return all rooms for the given hotel.

Rooms

All the rooms in the system. Room belongs exactly to one hotel.

get

Return all rooms present in the database.

get

Return room with the given id if such one exists.

delete

Delete room with the given id if such one exists.

get

Loads an image resource using ServletOutputStream. If there is no image path bound to the room, load a static image representing missing resource instead.

post

Creates a new Room if the input data are valid.

get

Returns a single Hotel by its number. Since the room number itself would be ambiguous, Hotel instance is also required.