Skip to main content
TransactionWorkspaceConnector is a per-row provenance junction that records which WorkspaceConnector sourced or received a given Transaction — analogous to DocumentWorkspaceConnector. Each row carries a direction discriminator (input = ingestion source, output = egress destination) so that a single transaction can be linked to multiple connectors in each direction without ambiguity. Tenant isolation is inherited transitively through the Transaction’s workspace and the WorkspaceConnector’s workspace rather than a direct workspace_pk column. As the highest-volume of the five entity-connector junctions (projected ~436 k rows at 18 months), it ships non-partitioned with two covering indexes: record-led and connector-led for sync-status range queries.
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 integer primary key, internal only, never exposed on the public API
  • created_at — set to new Date() on insert via MikroORM onCreate hook; never user-writable
  • updated_at — set to new Date() on insert and on every update via MikroORM onCreate + onUpdate hooks; null until first update
  • deleted_at — null on creation; written by application code for soft-delete; never hard-deleted
  • No transaction_workspace_connector_id UUID field is present on this entity — it uses only the internal serial pk (junction tables in this codebase omit the public *_id UUID unless externally referenced)
  • Rows are written exclusively by the connector sync pipeline (input direction) or by egress sync writers (output direction, iteration 4+); no user-facing PATCH route exists
  • Migration20260507000000 backfilled historical input rows from legacy entity.source_workspace_connector_pk values using an idempotent INSERT…SELECT NOT EXISTS guard; idempotency is NOT enforced by a UNIQUE constraint — no UNIQUE on (transaction_pk, workspace_connector_pk, direction) was shipped by design (deduplication is iteration 3+ work)
  • Two covering B-tree indexes ship with the table: idx_transaction_workspace_connectors_record_created on (transaction_pk, created_at) for record-led traversals; idx_transaction_workspace_connectors_wc_created_at on (workspace_connector_pk, created_at) for sync-status range queries

Example

Source: apps/api/src/database/entities/TransactionWorkspaceConnector.ts · domain: ingestion · tier: Infrastructure