How Unscheduled Hours on the Diary Work
Source: unscheduled_hours_controller.rb
- Unscheduled hours represent gaps between a mechanic's scheduled work time and the shop's operating hours
- Before-schedule and after-schedule gaps are returned as separate entries (e.g., if a mechanic starts at 8am but the shop opens at 7am, the 7-8am gap is a before-schedule unscheduled block)
- The calculation uses the default schedule (based on day_of_week_int) and does NOT factor in date-specific schedule overrides
- These hours represent available shop time where no mechanic is assigned
Support scenarios
- "The unscheduled hours don't match what I expect for today" → Unscheduled hours use the default recurring schedule, not any date-specific overrides. If a mechanic has a special schedule for today, the unscheduled hours calculation will not reflect it.
- "I see unscheduled time before and after the mechanic's shift" → This is correct. The system reports gaps on both sides of the mechanic's schedule relative to shop hours — before their start time and after their end time.