Skip to main content

Module heatmap

Module heatmap 

Source
Expand description

The month as a shape: GET /api/v1/team/heatmap.

The dashboard answers a week as totals and a moment as a pulse. Neither shows the pattern a manager actually reads a team by - who works weekends, whose month is ragged, who stopped filing days on the 12th. This endpoint is kasl sum widened by one axis: a row per person, a cell per local date.

Three rules, settled in ADR 0015 before the code:

  • A missing cell is missing data. Only dates with a workday are answered. Filling the month with zeroes would make the employee who never installed kasl look like the one who took the month off, and the first reading a manager reaches for is the wrong one of the two.
  • An open day has no total. worked_seconds is null while the day is running, as /me/days answers it. A half-lived day is not a short day.
  • The server does not own the scale. It answers seconds; what counts as a full day is a norm, and this installation has none until v0.21. A threshold shipped in the API would be an invention that is hard to take back.

Structs§

Cell
One day of one person’s month.
Heatmap
The team’s month.
MonthQuery
The month being asked for, as YYYY-MM.
Row
One person’s month.

Functions§

month
Answers the team’s month.
month_bounds
The first and last date of a YYYY-MM month.