Domain Model
Document
Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| id | string.uuid | Yes | — | Id |
| createdAt | string.date-time | Yes | — | Created at |
| updatedAt | string.date-time | Yes | — | Updated at |
| customerId | string | No | — | ID of the associated customer |
| vendorId | string | No | — | ID of the associated vendor |
| siteId | string | No | — | ID of the associated site |
| relatedEntityType | string | No | — | Related entity type |
| relatedEntityId | string | No | — | ID of the associated related entity |
| documentType | enum(proposal, contract, drawing, as_built, submittal, report, invoice, photo_set, configuration, certificate, permit, product_manual, other) | Yes | — | Document type |
| filename | string | Yes | — | Filename |
| objectStorageKey | string | Yes | — | Object storage key |
| mimeType | string | No | — | Mime type |
| uploadedByUserId | string | No | — | ID of the associated uploaded by user |
| documentDate | string.date-time | No | — | Document date |
| version | integer | Yes | — | Version |
| extractionStatus | enum(pending, processing, completed, failed, not_applicable) | Yes | — | Extraction status |
| aiSummary | string | No | — | Ai summary |
| classificationTags | string[] | No | — | Classification tags |
| workspaceId | string | Yes | — | ID of the associated workspace |
| visibilityMode | enum(global, workspace_local, shared) | Yes | — | Visibility mode |
Create Schema
Fields accepted when creating a new record:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| customerId | string | No | — | ID of the associated customer |
| vendorId | string | No | — | ID of the associated vendor |
| siteId | string | No | — | ID of the associated site |
| relatedEntityType | string | No | — | Related entity type |
| relatedEntityId | string | No | — | ID of the associated related entity |
| documentType | enum(proposal, contract, drawing, as_built, submittal, report, invoice, photo_set, configuration, certificate, permit, product_manual, other) | Yes | — | Document type |
| filename | string | Yes | — | Filename |
| objectStorageKey | string | Yes | — | Object storage key |
| mimeType | string | No | — | Mime type |
| uploadedByUserId | string | No | — | ID of the associated uploaded by user |
| documentDate | string.date-time | No | — | Document date |
| version | integer | Yes | 1 | Version |
| extractionStatus | enum(pending, processing, completed, failed, not_applicable) | Yes | "pending" | Extraction status |
| aiSummary | string | No | — | Ai summary |
| classificationTags | string[] | No | — | Classification tags |
| workspaceId | string | No | — | ID of the associated workspace |
| visibilityMode | enum(global, workspace_local, shared) | Yes | "workspace_local" | Visibility mode |
Update Schema
All fields are optional when updating:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| customerId | string | No | — | ID of the associated customer |
| vendorId | string | No | — | ID of the associated vendor |
| siteId | string | No | — | ID of the associated site |
| relatedEntityType | string | No | — | Related entity type |
| relatedEntityId | string | No | — | ID of the associated related entity |
| documentType | enum(proposal, contract, drawing, as_built, submittal, report, invoice, photo_set, configuration, certificate, permit, product_manual, other) | No | — | Document type |
| filename | string | No | — | Filename |
| objectStorageKey | string | No | — | Object storage key |
| mimeType | string | No | — | Mime type |
| uploadedByUserId | string | No | — | ID of the associated uploaded by user |
| documentDate | string.date-time | No | — | Document date |
| aiSummary | string | No | — | Ai summary |
| classificationTags | string[] | No | — | Classification tags |