280
Views
7
Comments
How To implement Get Available Room Functionallity in Booking Assignment

Hii,

I am not able To implement Logic to Get Available Cheaper Room That we got in Booking Assignment in Traditional Application, I want That in Reactive Application.

Booking.oml
2023-10-21 19-42-11
Tousif Khan
Champion

Hello

You need to write a Querry in Sql widget to fetch the rooms

Hope this helps

Also you can refer to below Oml

Best Regards 

Tousif Khan

Booking_Sample.oml
2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi @Tousif Khan ,

I don't know that assignment, but that query looks like it would fail to recognise a competing booking on the room if your desired booking starts before and ends after it.

And maybe that is not a possibility, but it looks like it would also fail to find any room if you are booking for 0 adults and more than 0 children.

Dorine

2023-10-21 19-42-11
Tousif Khan
Champion

Hello @Dorine 

If you have some better options available please share it would be really helpfull

I have just share what is mentioned in a document which is provided by OutSystems

you can check here

https://www.outsystems.com/training/lesson/849/bookings-assignment

This query is written in the resources shared by OutSystems

and for the second 0 adults and more children

there is a client side validations that ae covered to avoid this


2021-09-06 15-09-53
Dorine Boudry
 
MVP

Ah, Oke,

I didn't realise you were sharing something that you didn't come up with yourself.


oke, so in that assignment the business rule is that you can't book a room for only children.  I still don't see the point of having condition @NumberOfAdults > 0 in that query, but I guess it can't hurt.


As for the checking if there is no other booking already for the room, that condition is just wrong, in the NOT EXISTS clause, it should say something like :


{Booking}.[CheckOut] > @CheckIn AND {Booking}.[Checkin] < @CheckOut 

or if a new guest can't start using a room on the same date as previous guest left :

{Booking}.[CheckOut] >= @CheckIn AND {Booking}.[Checkin] <= @CheckOut 


Dorine

UserImage.jpg
Prashant Singh

HIi, Tousif

This Assignment Is Actually In Traditional Web Alpplication But I want to implement that in Reactive So for Reactive I am not able to Perform This Activity.

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Well one of the tags added is Traditional. Next time you post a question, select also the application type. This way people can better help you.

That said you can still use SQL also in reactive web using a Data Action or as part of a Server Action.

UserImage.jpg
Sherya Shah

What was the Query where the user has already checkout before the checkout date ? if any idea

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.