Skip to main content
CompanyCategory is a pivot relation that links a Company to a Category within the Well financial graph. It carries no business attributes beyond the join keys and a creation timestamp, enabling a many-to-many classification of companies by user-defined categories (e.g. “Supplier”, “Client”). Rows are soft-deleted via deleted_at rather than hard-deleted, preserving the audit trail of historical classifications. The entity is written exclusively by the connector-sync and enrichment pipelines; users cannot create or mutate rows through a resource PATCH.
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 — serial auto-increment integer, internal join key only; never exposed in the public API
  • created_at — set once on INSERT via MikroORM onCreate: () => new Date(); no onUpdate hook exists on this entity
  • deleted_at — written by the system (pipeline or service layer) when the pivot row is logically removed; never user-settable via PATCH
  • No UUID public identifier (company_category_id) exists on this entity — the row is identified exclusively by its compound context (company + category). The JSON:API id is therefore the internal pk.
  • No updated_at column — the entity has no MikroORM onUpdate hook and the migration DDL confirms the column is absent.

Example

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