ExBooking. AvailabilityRule
(ExBooking v0.1.0)
View Source
Offerable-time and policy input for one resource.
An availability rule describes weekly wall-time windows in a named timezone, optional date overrides, absolute blackout intervals, and policy constraints such as lead time or daily caps. Expansion turns this data into UTC intervals before busy time is subtracted.
Example
iex> rule = %ExBooking.AvailabilityRule{
...> timezone: "Europe/Stockholm",
...> windows: [%{weekday: 1, start_time: ~T[09:00:00], end_time: ~T[17:00:00]}],
...> lead_time_min: 60
...> }
...>
...> {rule.timezone, rule.lead_time_min}
{"Europe/Stockholm", 60}
Summary
Types
Buffer minutes applied around busy time.
Replacement windows for one date; windows: [] removes the day.
Availability rule for a resource.
A weekly wall-time window. ISO weekday, Monday = 1. An end_time <= start_time expresses a window crossing midnight into the next day
in the rule timezone.
Types
@type buffers() :: %{before_min: non_neg_integer(), after_min: non_neg_integer()}
Buffer minutes applied around busy time.
Replacement windows for one date; windows: [] removes the day.
@type t() :: %ExBooking.AvailabilityRule{ blackouts: [ExBooking.Interval.t()], booking_window_days: pos_integer() | nil, buffers: buffers(), lead_time_min: non_neg_integer(), max_per_day: pos_integer() | nil, overrides: [override()], timezone: String.t(), windows: [window()] }
Availability rule for a resource.
A weekly wall-time window. ISO weekday, Monday = 1. An end_time <= start_time expresses a window crossing midnight into the next day
in the rule timezone.