direction that distinguishes whether the connector was an input source (data collected into the invoice) or an output router (data distributed from the invoice). Tenant scope is inherited transitively through the Invoice’s workspace relationship and the WorkspaceConnector’s workspace. The table follows the document_workspace_connectors pattern established as the canonical per-entity provenance junction, replacing an earlier rejected targetWorkspaceConnector ManyToOne shape; it ships in parallel with the legacy source_workspace_connector_pk column on the Invoice entity, which will be backfilled and eventually dropped in a future migration.
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
- created_at — set by MikroORM onCreate hook to the current timestamp at insert time; never written by the user
- updated_at — set by MikroORM onCreate hook at insert and refreshed by onUpdate hook on every subsequent save; never written by the user
- deleted_at — soft-delete marker set by the connector sync pipeline or an administrative cleanup pass; not user-settable
- pk — auto-incremented serial primary key assigned by PostgreSQL at insert; internal join key never exposed on the public API
- No public UUID (*_id) field exists on this entity — the public API references rows through their relationships (invoice_id + workspace_connector_id), not a standalone junction UUID
- Rows are created exclusively by the connector sync pipeline when an Invoice is ingested by or routed through a WorkspaceConnector; no user-facing PATCH route exists for this entity
Example
apps/api/src/database/entities/InvoiceWorkspaceConnector.ts · domain: ingestion · tier: Infrastructure