Staff rotas and availability: setting them up so online booking stays honest
A slot is a claim that a qualified person is free. The seven things it is computed from, the default that causes the most awkward mornings, and why preventing double booking has to happen in the database rather than in the software.
Sohail Safdar · · 6 min read
An online booking page makes a promise with every slot it shows: a qualified person is free then, for long enough, at that location. Everything else about booking software is downstream of whether that promise is true.
It is computed from seven things. Most problems with online booking are one of the seven being wrong rather than anything wrong with the booking.
1. Working hours, per person, per location
Each person's regular hours, and where they are each day if they move between branches. "Tuesdays at Northgate, Thursdays at Main Street" is a rota and needs to be in the system as one, not as something everybody knows.
The two-location case is where this is most often fudged, by giving somebody the union of both branches' hours. The result is a customer booked at Main Street on a Tuesday, which is a phone call.
2. The services each person is qualified to deliver
This is the setting most often left alone and it causes the most awkward mornings. The default in nearly every system is that everybody can do everything, which is almost never true: a hygienist is not doing a crown, a junior stylist is not doing a colour correction, one of your three technicians is the only one certified on the diagnostic rig.
The cost is specific. A customer books, arranges their day, and then gets a call moving them, which is worse than never having been offered the slot. And the person who has to make that call is the person whose morning it already ruined.
Set it once per person. It takes ten minutes and it removes a recurring category of problem.
3. Existing appointments
Obvious, and worth one sentence about where it goes wrong: appointments made outside the system do not count. A regular booked by text, a favour squeezed in, a slot blocked verbally. Anything not on the calendar is invisible to availability, and availability will cheerfully sell it.
4. Time off
Holidays, training, their own appointments. Enter them as soon as they are known rather than as soon as they are relevant, because a booking made into time off is always discovered later than the time off was.
5. Location holidays
Days the whole place is closed. Set the ones you already know months ahead: public holidays, the week between Christmas and New Year if you close, the day of the annual stocktake.
This is the one that produces the most embarrassing version of the problem, because a customer booked on Christmas Eve when you are shut has been told something about you.
6. Buffers, before and after
Time either side of a service for setup, clean-up, notes or turnaround. A 45-minute service with a 10-minute buffer takes 55 minutes of the calendar, and the slot grid has to be built from 55 rather than 45.
Worth knowing that before and after are different needs. A room needing cleaning wants an after-buffer. A treatment needing setup wants a before-buffer. A service needing both has both, and a system offering only one number will have you padding the service duration instead, which then shows the customer a longer appointment than they are having. Booking buffers and turnaround time covers how much.
7. Minimum notice, and how far ahead
Two settings that are easy to miss and cause real problems.
Minimum notice is how close to now a customer may book. With none, somebody books a 20-minute appointment in 8 minutes' time and nobody sees it until they walk in. With too much, you lose the same-day bookings that are some of the easiest revenue you have. An hour or two suits most trades; a mobile trade needs travel time in it.
The horizon is how far ahead the page will go. Too short and a customer who wanted their regular six-week appointment cannot make it. Too long and you are taking bookings for a rota that does not exist yet, which produces the Christmas Eve problem above at scale.
Why the double-booking guarantee cannot live in the software
This is the part worth understanding, because it is the difference between a system that rarely double books and one that cannot.
Checking availability and writing the appointment are two steps. Between them, another request can run the same check and get the same answer. Two customers, two valid checks, two writes, one slot. Both were correct at the moment they were made.
No amount of careful application code closes that gap on its own, because the gap is between the check and the write, not inside either. The guarantee has to be in the database: a constraint that refuses the second overlapping appointment outright, whatever the software believed.
Worth asking a vendor directly, because the answers differ sharply. "We check availability before booking" is the version that occasionally double books under load, which is exactly when you are busiest. "The database refuses it" is the version that cannot. Double booking and how software prevents it goes through this properly.
The timezone, briefly
Each location's hours are local times at that location, which means each location needs its own timezone, stored as a region rather than an offset. A business with branches in two zones that holds one timezone for the whole business is wrong about one of them, and gets more wrong twice a year when the clocks move. Timezones and online booking is the whole story and it is shorter than it sounds.
A ten-minute monthly check
Once a month, open next month and look at each person:
- Is their time off in?
- Are the location holidays in?
- Did anybody change their regular hours and tell somebody rather than the system?
- Is anybody still bookable for a service they stopped doing?
That last one is the sleeper. Staff learn new services and stop offering old ones, and the qualification list is the thing nobody revisits.
When somebody calls in sick
Order matters, and most people get it backwards.
First, enter the sick day as time off. That stops the system offering more slots in the hole you are about to spend an hour filling.
Then work the already-booked list: move what you can to another qualified person, call the rest.
Then check the waitlist, if you keep one, because the customers you are about to disappoint and the customers waiting for an opening are two lists that can sometimes be resolved against each other.
Doing it in the other order is how a practice spends forty minutes rebooking four customers and discovers a fifth booked online into the gap while they were on the phone.
In Frontiva
Bookings computes availability from all seven inputs above: each staff member's working hours per location, the services they are qualified for, their existing appointments, their time off, the location's holidays, the buffers on each side of the service, and the minimum notice, all resolved in the location's own timezone.
Double booking is refused by a Postgres exclusion constraint rather than by an availability check, for the reason in the section above, and the guarantee is tested with fifty concurrent requests for the identical slot: exactly one succeeds. The public booking page runs through the same engine and the same constraint as the staff calendar, because two implementations is how two implementations start giving different answers, and the one customers see would be the unverified one.
One honest gap: calendar sync with Google and Microsoft is not available yet. If a staff member keeps their own commitments in a personal calendar, the rota does not know about them, and until that sync exists the rota is the only source of truth the booking engine has.