app.occupancy_counters
TableRow level security on
A live occupancy counter (Section 4.9) for a space or entrance on a project: the current count against the permitted occupant load, with alerts at 80, 90 and 100 percent.
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 the counter runs on.References app.projects.id |
| space_id | uuid | Yes | Space counted; required unless the load comes from a permit.References app.spaces.id |
| name | text | No | Counter name, for example Main Floor. |
| load_basis | app.occupancy_load_basis | No | Space Capacity, Occupant Load Factor or Permit. |
| metric_domain | text | Yes | Bible metric domain of the load factor (capacity).References xpms.dim_metric.domain |
| metric_item | text | Yes | Bible occupant load factor used, for example Assembly - standing space.References xpms.dim_metric.item |
| permitted_load | integer | No | Permitted occupant load. |
| current_count | integer | No | People inside now, kept by the door counts. |
| alert_level_percent | smallint | No | Highest alert level (80, 90 or 100) the count currently meets; 0 below 80. |
| closed_at | timestamp with time zone | Yes | When counting stopped. |
| 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. |