One customer wanted a booking system that allowed 3 bookings at most at one time with a 15 minute buffer in between. So was born www.bookmedanno.com (you have to be old to get that joke). Coming is the ability to book and pay for a booking – but that aside …
The big challenge was all the time synchronizing and ability to recursively see all bookings overlapping and then calculating anything with a depth of 3 or more layers – needed to be unavailable to book. Here is the website link – don’t finish a booking – as it is live unless you book something for playalatte.ca in Calgary, Alberta canada for a mom/dad and their tot.
- an SQL could not do this alone – first get all the information in a large time window (i.e. a day) via SQL
- using recursion, look at all the return results against each other
- calculate the depth at each start and stop of a booking and keep a tally array as you go along
- go through that tally array and make a new array of when you go in and out of 3 bookings or more
- THEN lastly make an inverse array of what is free and plot this visually and make a listing of bookings/times from this on pulldown lists
That was interesting and challenging – thought it might help someone else out on the web.