Skip to main content

Documents and Attachments

The document system separates the document definition from its attachment links. A single document can be attached to multiple entities without duplication, and each document maintains its own version history.

Document definitions

The central document index stores logical documents — files, URLs, or inline text.

Identity and classification:

AttributePurpose
Document codeBusiness-readable identifier (unique per organisation + tenant)
TitleDisplay title
CategoryLookup-backed category (e.g. POLICY_WORDING, CONTRACT, INVOICE)

Content types:

TypeMeaning
FILEBinary file
URLExternal URL reference
SHORT_TEXTInline short text content
LONG_TEXTInline long text content
WEB_PAGEWeb page reference

Storage types:

TypeMeaning
CloudCloud object storage
INLINEContent stored directly in the document record
EXTERNAL_URLExternal URL reference

Source tracking — for documents fetched from external sources, the system records the original URL, ETag, last-modified timestamp, and a content hash for change detection and deduplication.

Security — each document has a visibility scope (NONE, ORGANIZATION, TENANT), a usage type (one-time/private or standard/shareable), and a publish flag controlling broader access.

Status lifecycle: DRAFT → ACTIVE → PROCESSING → PROCESSED → FAILED → ARCHIVED

Attachments

A generic linking mechanism connects documents to any entity in the system:

AttributePurpose
DocumentThe document being attached
Entity typeThe type of the target entity (e.g. Customers, Jobs)
EntityThe specific target entity
Attachment typeHow the document relates to the entity

This approach avoids needing separate attachment configuration for every entity type. Any entity type in the platform can have documents attached to it.

Versioning

Documents maintain a version history. Each version records a sequential version number, file size, content hash, and change description. The document always tracks which version is the current one.

Access control

Documents use relationship-based access control:

  • The creating user is automatically recorded as the document owner
  • Read access requires domain permission, ownership, or a viewer relationship
  • Update access requires domain permission or an editor relationship
  • Any authenticated user can create a document