How Unavailable Times and Schedule Exceptions Work
Source: unavailable_times_controller.rb, unavailable_time_exceptions_controller.rb
- Default (recurring) unavailable times require a mechanic to be assigned and must specify a day of the week
- Default unavailable times cannot be set as all-day; they require specific start and end times within the mechanic's scheduled hours
- Bulk creation of unavailable times auto-adjusts times to fit within the mechanic's schedule, silently clipping any portion that falls outside working hours
- Bulk creation silently skips any invalid entries without raising errors; single creation mode raises validation errors for the same issues
- Unavailable time exceptions override recurring unavailable blocks for a specific date (e.g., a mechanic normally unavailable Friday afternoons can be made available for a specific Friday)
- Company-wide holidays are created by setting mechanic_id to null, which blocks the entire day for all mechanics
- The recurring unavailable time must fall within the mechanic's scheduled hours for the specified day of the week
Support scenarios
- "I set an unavailable time but it shows different hours than what I entered" → Bulk creation auto-adjusts times to fit the mechanic's schedule. If the time extends past the mechanic's scheduled hours, it is silently clipped to fit.
- "I created unavailable times in bulk but some are missing" → Bulk creation silently skips invalid entries (e.g., times outside schedule, missing data). Check the mechanic's schedule for those days to confirm the times are valid.
- "A mechanic should be available on a specific day despite their recurring unavailable block" → Create an unavailable time exception for that specific date. Exceptions override the recurring rule.
- "I want to block the whole shop for a holiday" → Create an unavailable time with mechanic_id left blank (null). This creates a company-wide holiday blocking all mechanics for that day.