Domain Model
Deficiency Report
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 |
| workspaceId | string | Yes | — | ID of the associated workspace |
| siteId | string | Yes | — | ID of the associated site |
| workOrderId | string | No | — | ID of the associated work order |
| inspectionDate | string.date-time | Yes | — | Inspection date |
| inspectorId | string | Yes | — | ID of the associated inspector |
| reportStatus | enum(draft, submitted, reviewed, closed) | Yes | — | Report status |
| deficiencyCount | integer | Yes | — | Deficiency count |
| summary | string | Yes | — | Summary |
| findings | unknown | Yes | — | Findings |
| remediationQuoteId | string | No | — | ID of the associated remediation quote |
| remediationWorkOrderId | string | No | — | ID of the associated remediation work order |
| reviewedBy | string | No | — | Reviewed by |
| reviewedAt | string.date-time | No | — | Reviewed at |
| notes | string | No | — | Notes |
| visibilityMode | enum(global, workspace_local, shared) | Yes | — | Visibility mode |
Create Schema
Fields accepted when creating a new record:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| workspaceId | string | No | — | ID of the associated workspace |
| siteId | string | Yes | — | ID of the associated site |
| workOrderId | string | No | — | ID of the associated work order |
| inspectionDate | string.date-time | Yes | — | Inspection date |
| inspectorId | string | Yes | — | ID of the associated inspector |
| reportStatus | enum(draft, submitted, reviewed, closed) | Yes | "draft" | Report status |
| deficiencyCount | integer | Yes | — | Deficiency count |
| summary | string | Yes | — | Summary |
| findings | unknown | Yes | [] | Findings |
| remediationQuoteId | string | No | — | ID of the associated remediation quote |
| remediationWorkOrderId | string | No | — | ID of the associated remediation work order |
| reviewedBy | string | No | — | Reviewed by |
| reviewedAt | string.date-time | No | — | Reviewed at |
| notes | string | No | — | Notes |
| visibilityMode | enum(global, workspace_local, shared) | Yes | "workspace_local" | Visibility mode |
Update Schema
All fields are optional when updating:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| siteId | string | No | — | ID of the associated site |
| workOrderId | string | No | — | ID of the associated work order |
| inspectionDate | string.date-time | No | — | Inspection date |
| reportStatus | enum(draft, submitted, reviewed, closed) | No | "draft" | Report status |
| deficiencyCount | integer | No | — | Deficiency count |
| summary | string | No | — | Summary |
| findings | unknown | No | [] | Findings |
| remediationQuoteId | string | No | — | ID of the associated remediation quote |
| remediationWorkOrderId | string | No | — | ID of the associated remediation work order |
| reviewedBy | string | No | — | Reviewed by |
| reviewedAt | string.date-time | No | — | Reviewed at |
| notes | string | No | — | Notes |