pub struct DayUpload {
pub date: NaiveDate,
pub started_at: DateTime<FixedOffset>,
pub ended_at: Option<DateTime<FixedOffset>>,
pub pauses: Vec<PauseUpload>,
pub tasks: Vec<TaskUpload>,
pub tasks_are_complete: bool,
}Expand description
One day as this agent recorded it, in the shape the server accepts.
Field names and types mirror the ingest contract (ADR 0004 in
kasl-server) rather than kasl’s own model, so a change on either side
shows up as a compile error here rather than as a 400 in the field.
Every instant carries a UTC offset. kasl stores bare wall-clock text, which is unambiguous on one laptop and meaningless across a team; the offset is attached when the day is assembled, and a day whose offset cannot be determined is not sent (ADR 0003).
Fields§
§date: NaiveDateThe employee’s own calendar date, sent rather than derived: near
midnight the date of started_at and the date the work belongs to
disagree, and the agent is the side that knows which is meant.
started_at: DateTime<FixedOffset>When the day started.
ended_at: Option<DateTime<FixedOffset>>When it ended; absent while the day is still open.
pauses: Vec<PauseUpload>§tasks: Vec<TaskUpload>§tasks_are_complete: boolDeclares tasks to be everything this agent holds for the date, so a
task the employee deleted here is deleted there too (ADR 0005).
kasl always sends the whole date, so this is always true. It is a field rather than a constant because the server defaults it to false for agents that predate it, and saying it explicitly is what distinguishes “I have nothing more” from “I did not mention”.