Hello everyone!
I’m reaching out because I’m stuck on developing a somewhat complex functionality.
What I would like to do is to create a “booking” system for a hair salon.
The goal is to build a system that would look like Calendly. The salon’s clients should be able to go on the application, choose their hairstyle, and then select a date on a calendar, which would display the salon’s availability for the selected day.
Some details:
- Depending on the chosen hairstyle, the duration of the appointment will vary (between 1 hour and 6 hours).
- The display of availability should consider the schedules of all the salon’s hairstylists. For example, if a client chooses a hairstyle that takes 3 hours and the time slot from 11:00 AM to 12:00 PM is available, but the slot from 12:00 PM to 1:00 PM is not, the person should not be able to select the 11:00 AM slot (as there is not enough time to complete the hairstyle).
What I have done so far:
- I have created an option set called “hours” that contains all the time slots in a day, spaced by 30 minutes (9:00 AM, 9:30 AM, 10:00 AM, etc.).
- I have created a data type called “reservation” that includes a field for the hairstylist and a field for the selected time slots as a list.
This allows me to display the availability for a selected hairstylist (I simply perform a “do a search for” to check if there are any reservations with that hairstylist for the selected calendar day. If that’s the case, I remove the corresponding “hours” from the selectable time slots list based on the “reservation” data type).
The problem:
- This method only considers the schedule of one hairstylist, not all of them.
- It only takes into account the available “hours”. As mentioned earlier, if a client selects a hairstyle that takes 3 hours and the 9:00 AM slot is available (due to no reservation), but the 10:00 AM slot is not, the 9:00 AM slot will still be offered (even though there is not enough time available).
That’s about it. It’s quite complex, so I hope someone will take the time to understand and help with my issue, haha.
Has anyone already implemented a similar booking system or have any suggestions to offer?
Thanks in advance!