Servicio tracks two kinds of time: shift (the employee is on the clock generally) and visit (the employee is on a specific visit). Both live in the same time_entries table with a kind discriminator.
How shift time is captured
Tech taps "Clock in" on their home screen at the start of the day. A kind=shift time entry opens. Tech taps "Clock out" at the end of the day; entry closes with minutes computed.
The tech app shows a live counter when on-the-clock, so they can see their running total.
How visit time is captured
The visit lifecycle auto-opens and auto-closes a kind=visit time entry:
- On
en_route: open a time entry (catches drive time). - If en-route was skipped, open on
arriveas fallback. - On
completeorskip: close the entry and compute minutes.
The visit's labor_minutes column caches the computed minutes so reports do not have to recompute on every page load.
The timesheet report
Owner → Team → Employees → click an employee → "Timesheet." Shows:
- Shift minutes. Total on-the-clock time.
- Visit minutes. Time spent on visits.
- Idle minutes. Shift minutes − visit minutes. Highlighted red when shift is >2× visit minutes (indicating a lot of paid-but-idle time).
- Labor cost. Minutes × hourly rate. Used in margin reports.