Skip to content

Vault

Document store

Tier: Platform · Status: ⬜ Not started

Purpose

Vault stores documents: the bytes, their type, their integrity hash, and the storage backend that holds them. Engines that need attachments — Registry, Strata, Docket — receive a document_id and create a link. They do not own storage configuration.

Vault is platform infrastructure (alongside Keycloak and the database), not a supervisory engine in the five-tier model.

Model

Entity Role
document Filename, mime type, byte size, content hash, storage backend, storage locator, upload audit
storage_backend Reference data: driver (s3, filesystem, azure_blob, …) and driver config
document_link Attaches a document to another record (linked_type + linked_id) with a purpose
erDiagram
    DOCUMENT }o--|| STORAGE_BACKEND : "stored on"
    DOCUMENT ||--o{ DOCUMENT_LINK : "attached via"

    DOCUMENT {
        uuid document_id PK
        string original_filename
        string mime_type
        bigint byte_size
        string content_hash
        string storage_backend_code FK
        string storage_uri
        uuid uploaded_by
        timestamptz uploaded_at
    }
    STORAGE_BACKEND {
        string code PK
        string name
        string driver
        jsonb config
    }
    DOCUMENT_LINK {
        uuid document_link_id PK
        uuid document_id FK
        string linked_type
        uuid linked_id
        string document_purpose
    }

Callers pass bytes (or complete a pre-signed upload); Vault returns document_id. Changing storage backend is a storage_backend configuration change, not a change to every consumer.

document_purpose on the link classifies why the file is attached (for example licence_certificate, supporting_return, evidence). Mime type classifies what the file is (application/pdf, …).

Owns

  • Document metadata, content hash, mime type
  • Storage backend catalogue and locators
  • Polymorphic document links

Does not own

  • Licensing application checklists and “criteria met” for required application documents
  • Business rules for which attachments a return template requires — return templates and Assay
  • Retention / legal-hold policy (owned with Seal / Docket evidence semantics when specified)

Consumers

Consumer Use
Registry Documents linked to parties and licences
Strata Supporting documents on submissions
Docket Case evidence
Assay Attachment completeness against return templates