Database Schemas - DistributedTravels/Documentation GitHub Wiki
Databse Schemas
Offers Service
Service uses only one Trip table which contains all necessary informations about trips registered during work of service. Each entry is created for each new trip.
Reservation Service
Service uses only one ReservationEntity table which contains all necessary informations about reservations made by users during work of service. Each entry is created for each new booked reservation.
Transport Service
Destination and Source tables are static data tables, as of current version not modified by any service action. Destination stores names and distances to travel destinations, while Source stores names of departure cities in Poland.
Travel table is most crucial as it stores all data about available travels (flights), for a specific flight it includes Source & Destination of a travel, departure time, number of free seats and price per seat.
When a reservation is being made, the important details from transport's viewpoint are stored in Reservation table. Details include a reference to which flight it belongs to and number of seats to make temporarily unavailable.
Booking table stores a history of purchases of seats and a new entry is added once a purchase for previous reservation has been made.
Hotels Service
Database of this service contains three tables: Hotel, Room and Reservation.
Hotel and Room tables are static and not changed by actions made inside the service. Hotel table stores information about hotels: name, localization, facilities of the hotels. Rooms table in addition presents data about rooms in these hotels (stores types of rooms). Main function of this table is to serve as a list of available rooms in every hotel.
Reservation table is the only one which can be changed during service work. It stores information about reservations made by users. Every record is related to the room from the Room table and stores following information: begin and end date of reservation, id of user to whom reservation belongs, and reservation number. Making a reservation adds records to this table, unreserving removes them.