Expand description
Importing an agent’s local history.
A team that adopts kasl-server late has employees who tracked their time locally for months. That history is in an ordinary SQLite file on their machine, and it should not be thrown away because the server arrived after it. This reads that file and writes the days into the server’s tables.
The awkward part is time. kasl stores bare wall-clock text - datetime(..., 'localtime'), no offset anywhere - which is unambiguous on the one machine
that wrote it and meaningless to a server serving several time zones. There
is nothing in the file to recover the offset from, so whoever runs the
import states it, and the choice is theirs to make and to get wrong (ADR
0003, ADR 0006).
Structs§
- Agent
Day - One workday as it appears in the agent’s database.
- Agent
Pause - Agent
Task - Import
Summary - What an import did, for the operator to read back.
Functions§
- at_
offset - Applies the operator’s offset to a wall-clock time from the agent.
- read_
agent_ db - Reads an agent’s database into days, newest last.
- resolve_
user - Finds the user an import writes for, refusing to invent one.
- within
- Keeps only the days within an inclusive date range.
- write_
days - Writes the days into the server’s tables, as the given user.