booking app for a doctors office

-1
I have created an app for a doctor's office for reservations so I want to control the available time in relation to the date, for example if it is Saturday the available time is from 7 to 10 and if it is Sunday, no time. And I want to avoid double bookings help me please  
asked
2 answers
0

Hi Youssef,

You can use the function ‘weekday-from-dateTime()’ (see Docs) to check what day the date selected is. If it’s a Saturday Vs. Weekdays you return a different list of available times for bookings.

To avoid double bookings you need to implement something like ‘isBooked’ (boolean) attribute on the time slots (which I assume is an entity). This boolean is changed to ‘true’ from the default ‘false’ once user confirms the booking and the list showing the available time slots (like in your screenshot) should only show the list of time slots where isBooked = false.

answered
0

Hi Youssef,

Something like this to create your AppointmentSlot objects (see below) – *right-click* → copy image and paste into Paint to see it better.

answered