Presentation is loading. Please wait.

Presentation is loading. Please wait.

Hotel reservation DB specification Benjamin Ard Tom.

Similar presentations


Presentation on theme: "Hotel reservation DB specification Benjamin Ard Tom."— Presentation transcript:

1 Hotel reservation DB specification Benjamin Ard Tom

2 Message summary

3 Messages to/from HR ● AvailabilityRequest :: (RoomType, Dates :: [Date]) ● AvailabilityResponse :: [ (Date, AmountOfAvailableRooms) ] ● PriceRequest :: (RoomType, NumberOfPersons, Date) ● PriceResponse :: Price ● RoomTypesRequest :: () ● RoomTypesResponse :: [RoomType]

4 Messages to/from UI ● ReserveRequest :: ( UserId, DateFrom, DateTo, RoomsAmount, NumberOfPersons, CustomerDetails :: (Name, Surname, Address, PaymentDetails) ) – NB! Removed datatypes, changed RoomNumber and CreditCardDetails ● ReserveResponse :: {Accept|Reject|Error} – Accept :: ReservationID ● NB! Removed CustomerID and CustomerPassword – Reject – Error

5 Messages to/from UI ● CancelRequest :: (ReservationID, UserId) – Removed CustomerID and CustomerPassword ● CancelResponse :: {Accept|Reject|Error}

6 Database definition

7 Database Assumed Functionality ● The database supports locking of our relations (tables). – Lock(relation) – Unlock(relation) ● Relational algebra

8 Relations ● Reservations – RoomType – Amount – Date – CustomerID – ReservationID ● Customers – Name – Address – PaymentDetails

9 Constraint: Reservations ● For each RoomType and Date, the sum of Amount should not be greater than the Amount of the RoomType in the hotel.

10 Relations(2) ● RoomTypes – Amount – RoomDetails – MaxNumberOfPersons ● Price – Date – PricePerPerson – RoomType

11 Database functions

12 HR functions ● Availability – Input: a::AvailabilityRequest – Output: b::AvailabilityResponse – For each input a.Date calculate the amount of rooms that are available on a.Date and has a.RoomType.

13 HR functions ● Price – Input: a::PriceRequest – Output: b::PriceResponse

14 HR functions ● RoomTypes – Input: RoomTypeRequest – Output: b::RoomTypeResponse

15 UI functions ● Reservation – Input: ReservationRequest – Output: ReservationResponse – If Address and Payment details are valid ● Lock(Reservations) – Insert all data in Reservations and return Accept/Reject ● Unlock(Reservations) – Else return Error

16 UI functions ● Cancellation – Input: CancelRequest – Output: CancelResponse – If input data is valid ● Lock(Reservations) – Remove reservation with the ReservationID equal to the given ReservationID and return Accept/Reject ● Unlock(Reservations) – Else return Error


Download ppt "Hotel reservation DB specification Benjamin Ard Tom."

Similar presentations


Ads by Google