Hi,
I'm making the Web Development course in Final Project making Booking Assignment, stuck at screen lifecycle step.
I already make Rooms Screen with drag and drop attribute to the screen for making column table also Booking Screen and New booking screen.
My problem:
I'm a beginner here, I am very grateful if you explain to me specifically.
Thanks
Ayu Andini wrote:
Andres Moreno wrote:
Hello,
So the first thing I would recommend is to go to your Main Flow and drag and drop the Booking table two times. This will create the List page and the Detail page. The main difference you will see with this is that you will get the Room and the Status as drop downs...
Now one thing you can is remove these two fields. And you can handle the state of a booking several ways but here is my quick way to do this.
- Adding a Check In and Check Out button that will update the Status of Booking. These options will only be available when there is a saved booking.
As for the calculation of the price you can do this on the Save. It can look something like this for the assignment.
The GetRoomById is an Aggregate that has the Room as the source and it filters by the RoomId of the booking.
How to know which Room to assign is a little bit more complicated because now you get into creating a whole scheduling system where you have to check which rooms are available.
...
I would think you assign the Room when you Check In, so maybe when you Check In it saves that status and it shows you a list of available Rooms then you select a Room and it saves. The price calculation would be done at the booking time, so whenever they set the check in and check out day you can get the number of days and calculate by the "Room Type" which is probably the missing piece. Your configuration instead of being per Room it can be per Room Type so now you can always calculate the full price based on room type, and then when they check in they get assigned a room that is available.
I hope this all makes sense.
Andres Moreno
Thanks for the reply Andres,
I've made List Page and Detail Page, this looks like:
I still don't understand to show price, I'm using expression what value of the expression for the calculation?
And, in New Booking page, have 2 buttons as I show mockup before:
In GetRoomById Aggregate I can't use the filter as you said. because Can't identify 'GetBookingById' element in expression. So I'm using Room.Id = RoomId
Okay, so doing it that way, you will need to store the chosen room in a Local Variable. Then I would have the expression wrapped in a Container, that only shows when that variable has a value (For example if the variable names is ChosenRoom, the Container that container "Room Number at $$$ per night" would have the visibility set to "ChosenRoom.Id <> NullIdentifier()"). Then instead of doing the dropdown for the Room there I would do everything as an as an expression that looks like this:
When you press the "Book Room" you can then assign the RoomId to the Booking before you save:
Hello Ayu,
I do not remember the whole Assignment but based on your questions I think I can provide answers to them.
1 - On you Bookings 'Preparation' the aggregate that is loading the Bookings, does it have a join to the Status table, if not that is why it does not let you drag and drop it to the Screens data table. Make sure that in the Aggregate you have the Status as a Source and the appropriate Join condition. (If you send the OML I can provide more specifics on this answer)
2 - Can you expand on this question. If you want to show a status of 'N/A' or something like that you would need to edit the Expression to do an IF and show what you need accordingly. (If(RoomStatus = NullIdentifier(), "N/A", "RoomStatus.Label".
3 - These are required when you are adding a booking. Imagine you are making a reservation for a hotel, they will ask you when you are going to arrive and when you are going to leave, this way they can calculate your pricing based on the number of nights you are going to spend there. This is why both of them are required.
4 - You would need to have a table where it stores that information (more of an administration task) So you can have a Room table that contains Room Number, Price Per Night and whatever other information is necessary. Then you can have a configuration page where you can add new rooms to the system.
I hope this answers some of your questions, let me know if I can help you any further.
Hi Andres,
Thanks for the reply.
Yess, I can understand. Thanks a lot for your explanation.now I don't need to make a room number not the same as the others.
does the price of rooms define automatic? when I fill the form of adults and children.where can I apply the calculation?
If you don't mind, This is the Assignment: https://www.outsystems.com/learn/lesson/849/bookings-assignment/?LearningPathId=0
Thanks a lot.