Skip to content
Updated Sep 26, 2026 by Barča Dvořáková · Owner: analysisactiveentityconfluence-migration Edit on GitHub

Entity: responsiblePersonAssignment ​

Entity Type: Database table

Description: Assigns a user as responsible for a building. Drives the recipient list for notifications and actions raised against a building or one of its gauges. Replaces the EM2 pattern of implicitly inferring "the responsible user" from the first ROLE_WORKER-assigned user found.

Cardinality: many-to-many — a building may have several responsible users. This intentionally supports the case observed in EM2 staging data where the majority of buildings (60%) have more than one plausible responsible user; instead of picking one implicitly, EM3 assigns explicitly and notifies all of them.

Data Attributes Table ​

Attribute NameDescriptionData TypeDefault ValueRequired (= Nullable)UniqueFormatValidationsIndexExample
idPrimary key of the entity.UUIDGenerated in code (app layer)YesYesUUID v7-Primary Key018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2
tenantIdTenant this record belongs to.UUID-YesNoUUID v7Foreign Key → tenant; must exist-018fa51f-fda1-79f4-8461-2cb8f1cabc10
buildingIdThe building this assignment applies to.UUID-YesNoUUID v7Foreign Key → building; must exist-018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2
userIdThe user assigned as responsible. Must already be assigned to the building (existing User↔Building relationship) — this entity does not itself grant building access, only marks responsibility among already-assigned users.UUID-YesNoUUID v7No database foreign key exists; enforced only at the application layer via the building-access directory (a platform-scoped table outside this schema and outside RLS).-018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2
createdAtTimestamp of entity creation. Is immutable.Timestamp with time zonenow()YesNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ--2026-01-15T09:00:00Z
updatedAtTimestamp of last entity update. Mutable.Timestamp with time zonenow()YesNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ--2026-01-15T09:00:00Z
deletedAtTimestamp of entity soft delete. Once set, immutable.Timestamp with time zone-NoNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZImmutable once set. Active records: WHERE deletedAt IS NULL-null
createdByIdentifier of the author who created this record.String-YesNotype:actor--user:c2d3f586-1c9a-4f5f-b9ae-45f2c4f69f7e
updatedByIdentifier of the author who last updated this record.String-YesNotype:actor--user:c2d3f586-1c9a-4f5f-b9ae-45f2c4f69f7e

Audited fields ​

Recorded on created (in full) and deleted (in full) — this entity has no update path, so no field of an existing assignment ever changes: buildingId, userId.

Excluded: none.

Every entry carries subjectEntityType = building / subjectEntityId = buildingId — it does not self-subject. userId (the person assigned) is never the audit actor — the actor (createdBy) is whoever performed the assign/remove call, a distinct identity that only incidentally may coincide with userId.

Correction: userId previously claimed an enforced foreign key to user; no such database constraint exists — corrected above.

Not registered for entityName resolution — a join row (buildingId × userId), not a named record of its own.