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
- document_extraction_id — generated by gen_random_uuid() database default at INSERT; never supplied by the caller
- created_at — set once via MikroORM onCreate hook (new Date()); immutable after creation
- updated_at — set by MikroORM onUpdate hook (new Date()) on every subsequent flush; null until the first update
- deleted_at — written by the extraction orchestrator or backfill services to soft-delete superseded rows; the partial unique index is scoped to deleted_at IS NULL so a new parser run can replace a deleted cache entry without a constraint violation
- Cache-dedup logic — DocumentExtractionRepository (or the orchestrator) queries for an existing active row matching (document_pk, parser_name, parser_version, source_checksum) before calling the remote parser; a hit returns the stored text without an external API call
- source_checksum coalesce sentinel — the partial unique index uses COALESCE(source_checksum, ”) so a null checksum does not cause PostgreSQL to treat every null-checksum row as distinct (PostgreSQL treats NULLs as distinct in unique indexes by default)
- Workspace scope — workspace_pk is always set to req.workspace.pk at write time by the extraction pipeline; never accepted from client input
- parser_name and parser_version are stamped at extraction time from the calling service constant and the deployed parser SDK version; not user-supplied
Example
/Users/maximechampoux/platform/apps/api/src/database/entities/DocumentExtraction.ts · domain: ingestion · tier: Infrastructure