Availability is the concept that people most often misunderstand.
The default notion in Timekit is that a resource is available until blocked. Blocked meaning that a booking is reserving time in the calendar or that some general business-rules, like opening-hours have been applied.
This is contrary to the use-cases where the baseline is: A given resource is only available in these pre-defined time-slots, this is done through what Timekit calls group bookings.
Be sure to read the following section on availability-constraints!
When you want to find availability you're typically looking for a specific length of time where a resource is available, within a given period and applying some general business-rules. At least this is Timekits way of looking for availability at its core. These next paragraphs will describe how you define the specifics.
The search space is the period in which you want to search for availability. It is defined by the "from" and the "to" parameters. These two parameters take both absolute(timestamps) and relative(example: "2 days") values. The relative values are relative to "now" (the time at which the request is send to the API). So if you want to look for availability in the next two coming weeks, and today/now is friday, you would set "from" to "3 days" and "to" to "3 days 2 weeks". If you want to find availability in the next week/7 days, just omit "from" (it will default to "now") and set "to" to "1 week". If you do not set a "to" parameter in the request, Timekit will default to 4 weeks. Please note that you cannot currently set future to more that 6 months.
Time-slot length is defined by the "length" parameter, so if you're looking for time-slots of 2 hours length, you set the length parameter to "2 hours" and so forth. If you do not define the length parameter Timekit will default to 1 hour.
Timekit currently operate with three modes to query availability, these only have significance if you're querying availability for more than one resource.
- Round-robin random.
- Round-robin prioritized.
The round-robin modes will choose whichever resource is available at a given time-slot, according to the strategy. The mutual mode will ensure that all resources are available in a given time-slot.
The random strategy chooses resource randomly as the name suggests. The inner workings of Timekit's availability-algorithm dictates that once a resource has been found for a given time-slot, this resource will have precedence for the remainder of the of time-slots. This means that you will not see random resource-allocation between the produced time-slots, only if a time-slot is found where the first randomly chosen resource is not available, will there be a different resource allocated to that particular time-slot.
The prioritized round-robin strategy works in much the same manner, except that the resource with precedence is chosen based on the sequence given when defining resources.