11 - Bookings
11 - Bookings
11 - Bookings
Table of Contents
Outline 1
Hands-on 2
Create the Bookings application 2
Data Model 2
Rooms 3
Bookings 4
Check-in and Check-out 7
Homepage 8
Room Amenities 9
Occupancy for the Next 7 Days 10
Extra challenge - Room Service 10
Outline
In this project, we will create an application to manage hotel Bookings. This application will have
all the rooms of the hotel and also all the bookings made in the hotel.
Our application will be able to list all rooms, as well as create new rooms and edit the
information of existing rooms. Also, in each room, we will be able to add amenities, such as TV
or Crib. All of this can only be done by hotel clerks or the hotel manager.
Then, the application will allow the clerk / manager to create new bookings for guests, as well as
cancel them if needed. Then, when the check-in date comes, the hotel staff can check-in the
guests as well as proceed with the check-out at any time after the check-in.
1
The application will also have an homepage which will display the bookings with check-in date
and check-out date on the current date, as well as a view over the occupancy of the hotel in the
next 7 days.
At the end, there is an extra challenge to add the room service functionality to the application.
Hands-on
Create the Bookings application
To start this assignment, the first step is to create the Bookings reactive web application. In the
resources of the exercise, there is an icon to be used for the application.
The application should have two modules: one Core, for the data model, and one for all the UI
and business logic. Don’t forget that the names of the modules must be unique in the
environment.
Data Model
The application will require a very simple data model, with the following Entities.
All the attributes are mandatory except for the number of children and consider the following
statuses: Booked, CheckedIn, CheckedOut and Canceled.
2
Use the Room.xls file to populate the Room Entity with data.
Create the relationships you think are relevant for this application.
Rooms
The application will have a Screen to list all the Rooms available in the database. The Screen
should only be accessible by the Hotel Manager and the Hotel Clerk and it should look
something like this:
This Screen has a Save button and a Cancel link. The first one will save the data on the Room
Form to the database, while the link will go back to the Rooms Screen. The Screen should be
accessible by the hotel manager and the hotel clerk, but only the hotel manager will be able to
create a new room, or edit its information.
3
Bookings
The most important part of the application is to allow a hotel clerk (or manager) to create
Bookings for guests.
For that, it is important to list the existing Bookings and to create / modify Bookings in
the database.
Also, the clerk / manager should be able to search for guest names and / or the status of the
Booking. The list Screen should look like the following screenshot:
4
The application should automatically choose the cheapest available room option, when the
clerk / manager selects the Get Available Room option. To accomplish that, we can use the
following SQL:
SELECT {Room}.* FROM {Room}
(SELECT 1 F
ROM {Booking}
and (@CheckInDate b
etween {Booking}.[CheckInDate] and {Booking}.[CheckOutDate]-1
5
The Room row should only appear after the Get Available Room is selected.
Then, when the available room is selected, an option should appear to book the room or to
return to the Bookings page.
6
For the check-out, the hotel clerk / manager can only see that option, when the user is already
checked-in. In this case, since the guests can leave the hotel earlier if they want to, the
check-out can happen anytime between the check-in and check-out dates. This option should
also appear in the BookingDetail Screen.
In Service Studio, the Screen will look like the following screenshot, but depending on the
scenario, only the expected options should appear
7
Homepage
Now, we want to have a Homepage in our application. This homepage will display a banner and
then a list of bookings where the check-in date is today, and a list of bookings where the
check-out is today. That list should allow the hotel clerk / manager to check-in and check-out
the guests directly, without going to the Booking Detail page.
These lists should have the name of the guest, the room number and the check-out date, in the
Checking In Today list, and the check-in date in the Checking Out Today list. The Screen should
look like the following screenshot:
Notice that the Guest Name appears differently in these two lists. So, let’s standardize the way a
guest name appears on the app to something like this:
8
Room Amenities
Another functionality that the Bookings application will need to support is the addition of
amenities to a room. A Room can have the following amenities:
● Television;
● Internet Access;
● Hair dryer;
● Premium Towels;
● Crib;
● Safe.
To support this new functionality, the data model needs to be changed to include the
amenities. Don’t forget to create the respective relationships with the Room Entity.
In the Room Detail Screen, the list of amenities in the room should appear as in the following
screenshot:
9
The application should also have a new Screen to allow the hotel clerk / manager to add new
amenities to a room. A Room should not have the same amenity twice.
This information should be displayed in a chart, where the percentage of occupancy will be
displayed in the Y-axis and the days in the X-axis. At the end of this section, we should have a
Chart looking like this:
To create the Chart, we need a widget, which is a Line Chart. Find out more about Line Charts in
this section d
ocument.
To build the Line Chart, we need a list of data points. To build the chart we need to use a list of
data points. The list of data points in this case will have to represent the day and the
percentage of occupancy on that day. So, to build the chart, we need to have a list of 7
elements, one per day, with the relevant information in it.
The Line Chart and the Data Point type already exist. We just need to use it and build the list
we want to display the correct data on the chart.
10
To do that, we first need to change the Data Model to support the Room Service.
In the Homepage of the application, we will have a section to request a service to a Room. To
request the room service, the hotel clerk / manager will be able to select a room, select the type
of service that the customer wants and after the selection is made, the total price should
appear. Then, the hotel clerk / manager should confirm the Request by clicking on a Button.
The Room Service section should look like the following mockup:
11