Skip to main content
PersonPhone is a pivot entity that links a People record to a Phone record within a workspace, carrying metadata about the association. It implements the canonical pivot pattern with is_primary, is_verify, and label fields so a single person can hold multiple phone numbers under different categories. Records are written by the connector sync pipeline and by user-facing People mutations (add/remove phone); there is no standalone PATCH surface for individual person_phones rows. Soft-delete semantics via deleted_at are enforced, and partial unique indexes guarantee at most one primary phone per person at any time.
Internal object. Not currently exposed on the public REST API. The operations below describe the intended contract.

API operations

Data model

Attributes

Relationships

System-computed

  • pk β€” auto-increment serial, internal join key only; never exposed in the public API
  • created_at β€” set on INSERT by MikroORM onCreate: () => new Date() hook; no onUpdate hook exists on this entity (no updated_at column)
  • deleted_at β€” soft-delete field; set to current timestamp when the phone association is removed via People mutation or connector sync; null on active records
  • label default β€” ORM default PersonPhoneLabelEnum.OTHER (β€˜other’) applied on entity construction; also enforced as DEFAULT 'other' in PostgreSQL via the native enum column
  • is_primary default β€” ORM default false; also DEFAULT false in PostgreSQL
  • is_verify default β€” ORM default false; also DEFAULT false in PostgreSQL
  • Partial unique index uniq_person_phones_primary_person β€” system-enforced constraint preventing more than one primary phone per person among non-deleted rows; managed at DB level, not ORM level

Example

Source: apps/api/src/database/entities/PersonPhone.ts Β· domain: financial-graph Β· tier: Supporting