Skip to main content

Module model

Module model 

Source
Expand description

The domain the server stores: the shapes behind migrations/.

These types are the Rust half of the schema. They exist now, before the ingest API that fills them, so the tables have one authoritative reading - column, type and meaning together - instead of a SQL file plus whatever a handler happens to select.

Naming follows the database, and the database follows kasl: a reader who knows the agent’s model recognizes this one.

Nothing reads these structs yet - the ingest API and the queries behind it are the next milestones. They are allowed to sit unused rather than be written twice: the schema and its Rust reading land together, and the serialization test below already holds the wire names to the contract.

Structs§

Agent
One installed kasl reporting on a user’s behalf.
Pause
An interruption inside a workday: detected idleness or a manual break.
Report
The event of a report being submitted, with the figures as of that moment.
Tag
A label on tasks. Scoped to one user: vocabularies are personal.
Task
A task the employee logged for a day.
User
A person in the installation.
Workday
A working day of one person.

Enums§

ReportKind
Which period a report covers. Mirrors the report_kind enum.
UserRole
What a user may do. Mirrors the user_role enum in PostgreSQL.