app.clock_punches
TableRow level security on
Append-only record of clock punches as devices reported them (Section 13). The id is the client id, so a replayed punch is recognized. Written only by app.record_punch, which opens, closes and breaks time entries from them.
Primary key: id
| Column | Type | Nullable | Description |
|---|---|---|---|
| id | uuid | No | Client-generated punch id; a replay with the same id returns the stored punch. |
| 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 punched; NULL for external crew, who punch through engagement_id.References app.memberships.id |
| shift_id | uuid | Yes | Shift the punch works, when there is one.References app.shifts.id |
| time_entry_id | uuid | Yes | Time entry the punch opened, broke or closed.References app.time_entries.id |
| punch_kind | app.punch_kind | No | In, Break Start, Break End or Out. |
| device_time | timestamp with time zone | No | Time on the device's clock when the person punched. |
| monotonic_offset_ms | bigint | Yes | Milliseconds on the device's monotonic clock between the punch and its upload, to correct a wrong wall clock. |
| received_at | timestamp with time zone | No | When the server received the punch. |
| effective_at | timestamp with time zone | No | Time the punch counts at: the device time when it is within the skew tolerance, otherwise the time the server received it. |
| latitude | numeric(9,6) | Yes | WGS 84 latitude the device reported. |
| longitude | numeric(9,6) | Yes | WGS 84 longitude the device reported. |
| accuracy_m | numeric(8,1) | Yes | Reported accuracy radius in meters. |
| geofence_id | uuid | Yes | Geofence the punch was checked against.References app.geofences.id |
| geofence_verified | boolean | Yes | True when the server found the point inside the geofence (app.point_in_geofence), false when outside, NULL when not checked. |
| skew_flagged | boolean | No | True when the device time fell outside the skew tolerance; the entry is marked for review. |
| source | app.punch_source | No | Mobile or Kiosk. |
| kiosk_device_id | uuid | Yes | Kiosk the punch came from; Kiosk punches only.References app.kiosk_devices.id |
| photo_uri | text | Yes | Storage path of the punch photo, when the kiosk or org takes one. |
| 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 |
| deleted_at | timestamp with time zone | Yes | Soft delete time. A row with deleted_at set is ignored by every access helper. |
| engagement_id | uuid | Yes | Engagement of the external person who punched. Exactly one of membership_id and engagement_id.References app.engagements.id |