app.time_entries
TableRow level security on
Clock-in and clock-out punches. Entries of one person never overlap (invariant 20). Every change is written to app.time_entry_audit, and a change inside an approved timesheet voids the approval (invariant 19).
Primary key: id
| Column | Type | Nullable | Description |
|---|---|---|---|
| id | uuid | No | Primary key, UUID v7. |
| org_id | uuid | No | Owning org, derived from app.projects on insert; never accepted from the caller and never changed.References app.organizations.id |
| project_id | uuid | No | Project worked.References app.projects.id |
| membership_id | uuid | Yes | Membership of the person who worked; NULL for external crew, who work through engagement_id.References app.memberships.id |
| shift_id | uuid | Yes | Shift of the same person and project the entry works, when there is one.References app.shifts.id |
| clock_in | timestamp with time zone | No | When work started. |
| clock_out | timestamp with time zone | Yes | When work stopped; NULL while clocked in. |
| break_minutes | integer | No | Unpaid break minutes inside the entry. |
| source | app.time_entry_source | No | Web, Mobile or Kiosk. |
| kiosk_device_id | uuid | Yes | Kiosk device the punch came from, for Kiosk entries.References app.kiosk_devices.id |
| deleted_at | timestamp with time zone | Yes | Soft delete time. A row with deleted_at set is ignored by every access helper. |
| created_at | timestamp with time zone | No | When the row was inserted. Set by the database. |
| created_by | uuid | Yes | Person who inserted the row, or null for a platform process. Set by the database.References app.people.id |
| updated_at | timestamp with time zone | No | When the row last changed. Set by the database. |
| updated_by | uuid | Yes | Person who last changed the row, or null for a platform process. Set by the database.References app.people.id |
| auto_closed_at | timestamp with time zone | Yes | When the platform closed an entry left open longer than 16 hours; NULL when the person or a correction closed it. |
| needs_review | boolean | No | True while an entry needs a supervisor's review, for example after an automatic close or a skewed punch. |
| engagement_id | uuid | Yes | Engagement of the external person who worked, when they have no membership. Exactly one of membership_id and engagement_id.References app.engagements.id |