app.incidents
TableRow level security on
Incidents of a project (Incident CAD log). A critical incident cannot be relabeled and closed in one statement, and closing requires sign-off (invariant 22).
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.References app.projects.id |
| incident_number | bigint | No | Number from the project's display key sequence. |
| title | text | No | What happened. |
| severity_enum_id | text | No | Severity: a row of the canon Incident Severity enumeration; Level 1 - Critical is critical.References xpms.std_enumeration.record_id |
| zone_id | uuid | Yes | Zone where it happened.References app.zones.id |
| occurred_at | timestamp with time zone | No | When it happened. |
| reported_by | uuid | Yes | Reporter, from the session.References app.people.id |
| incident_state | app.incident_state | No | Incident state. Changes only through the incident RPCs. |
| closed_signed_off_by | uuid | Yes | Person who signed off the closure.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. |
| 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 |
| latitude | numeric(9,6) | Yes | Latitude where the incident was reported (WGS 84), when the reporter's device gave one. |
| longitude | numeric(9,6) | Yes | Longitude where the incident was reported (WGS 84), when the reporter's device gave one. |
| accuracy_m | numeric(8,1) | Yes | Horizontal accuracy of the location in meters, as the device reported it. |
| device_reported_at | timestamp with time zone | Yes | When the reporter filed the report on the device; differs from created_at when the report was queued offline. |