Schedules
A schedule sets the usual hours of a resource that counts time in buckets. It joins the resource’s capacity and its dated exceptions to determine what is free for a booking.
Buckets
settings.bucket sets the size and time zone. Step buckets start at local midnight and repeat at stepMinutes intervals on the local clock. Day buckets run from one local midnight to the next. Month buckets run from the start of one local calendar month to the next. A daylight-saving change can skip or repeat a local start time, so each slot has an exact start and end as well as a local label.
For a resource that counts units together, a bucket starts from the resource’s capacity, if set. Otherwise it counts instances that are active and available throughout that bucket. A resource with identity: 'instance' works out capacity for each named unit separately. Its bucket fits one unit at most. It has no place or holder dimension.
Weekly hours
A schedule has a named time zone and one or more weekly patterns. The first pattern has no start date. Each later pattern starts on its from date in the schedule’s time zone and replaces the one before it. Once a pattern takes effect, a save preserves it and changes only future patterns.
A step bucket must fit inside a single window. A day bucket uses the largest capacity from that weekday’s windows. A window with a capacity sets the capacity in place of the resource’s own. A pattern with no windows leaves every bucket open at its usual capacity. Month buckets skip weekly hours.
Exceptions
An exception sets capacity for a dated span. Even a partial overlap applies to the whole bucket. Where several exceptions overlap a bucket, the lowest capacity among them replaces the weekly capacity. A capacity of 0 closes the bucket to new claims when the resource enforces capacity.
Slots
Your server lists slots with its project secret key. Each slot gives capacity, taken, held, and available. The list skips a bucket when capacity, taken, and held are all zero. A resource that tracks units individually takes the unit’s instanceId in the slot query. Free instances answers the inverse question by listing units free for an entire span.
For a resource held per holder, Availability checks a span in the holder’s scope. Listing slots or checking availability reserves nothing. A hold or consume applies the shortage rule when it writes. Your server checks how far ahead someone can book, and how much notice they need, before it places a hold.
Over capacity
Reducing capacity leaves existing claims in place. A capacity change can answer with overCapacity, the buckets where taken plus held exceeds capacity. It lists the affected claims so your app can decide what to do. Nothing new takes a bucket at or over its capacity, unless the resource’s shortage is negative. You can still extend, commit, or release an open hold before it expires. You can cancel a committed booking. The destination’s shortage rule applies when you reschedule a held or committed line. Book time slots cancels a booking and moves one. When more is true, the answer covers only part of what the change needs to check or report.
Limits
- Step buckets use 1 to 1,440 minutes. A claim span and a slot query cover at most 2,000 buckets each.
- A schedule has at most 100 patterns and each pattern has at most 100 weekly windows. A resource has at most 500 exceptions.
- An
overCapacityanswer lists at most 100 buckets and 500 claims across them.
Where to act on it
- Book time slots sets capacity and books time. Build a booking page lists slots from your server. Limit hold length and booking window sets app rules for a hold.
- Schedules sets weekly hours and exceptions. Slots reads bucket availability.