Domain Model
Work Order
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 |
| ticketId | string | No | — | ID of the associated ticket |
| projectId | string | No | — | ID of the associated project |
| pmScheduleId | string | No | — | ID of the associated pm schedule |
| customerId | string | Yes | — | ID of the associated customer |
| siteId | string | Yes | — | ID of the associated site |
| workType | enum(service_call, installation, inspection, preventive_maintenance, emergency, other) | Yes | — | Work type |
| dispatchStatus | enum(unscheduled, scheduled, dispatched, en_route, on_site, completed, canceled) | Yes | — | Dispatch status |
| scheduledStart | string.date-time | No | — | Scheduled start |
| scheduledEnd | string.date-time | No | — | Scheduled end |
| technicianUserIds | string[] | No | — | Technician user ids |
| billableStatus | enum(not_billable, billable, invoiced) | Yes | — | Billable status |
| laborStatus | enum(not_started, in_progress, completed) | Yes | — | Labor status |
| materialsStatus | enum(none_needed, pending, fulfilled) | Yes | — | Materials status |
| customerSignoffStatus | enum(not_required, pending, signed, disputed) | Yes | — | Customer signoff status |
| workSummary | string | No | — | Work summary |
| recommendedFollowup | string | No | — | Recommended followup |
| priority | unknown | No | — | Priority |
| estimatedLaborHours | unknown | No | — | Estimated labor hours |
| actualLaborHours | unknown | No | — | Actual labor hours |
| estimatedMaterialCost | unknown | No | — | Estimated material cost |
| actualMaterialCost | unknown | No | — | Actual material cost |
| actualLaborCost | unknown | No | — | Actual labor cost |
| totalCost | unknown | No | — | Total cost |
| laborEfficiency | unknown | No | — | Labor efficiency |
| costVariance | unknown | No | — | Cost variance |
| checkInAt | unknown | No | — | Check in at |
| checkOutAt | unknown | No | — | Check out at |
| gpsCheckIn | unknown | No | — | Gps check in |
| gpsCheckOut | unknown | No | — | Gps check out |
| completionNotes | unknown | No | — | Completion notes |
| followUpRequired | unknown | No | — | Follow up required |
| isRevisit | unknown | No | — | Is revisit |
| requiredSkills | unknown | No | — | Required skills |
| invoiceId | unknown | No | — | ID of the associated invoice |
| 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 |
|---|---|---|---|---|
| ticketId | string | No | — | ID of the associated ticket |
| projectId | string | No | — | ID of the associated project |
| pmScheduleId | string | No | — | ID of the associated pm schedule |
| customerId | string | Yes | — | ID of the associated customer |
| siteId | string | Yes | — | ID of the associated site |
| workType | enum(service_call, installation, inspection, preventive_maintenance, emergency, other) | Yes | — | Work type |
| dispatchStatus | enum(unscheduled, scheduled, dispatched, en_route, on_site, completed, canceled) | Yes | "unscheduled" | Dispatch status |
| scheduledStart | string.date-time | No | — | Scheduled start |
| scheduledEnd | string.date-time | No | — | Scheduled end |
| technicianUserIds | string[] | No | — | Technician user ids |
| billableStatus | enum(not_billable, billable, invoiced) | Yes | "not_billable" | Billable status |
| laborStatus | enum(not_started, in_progress, completed) | Yes | "not_started" | Labor status |
| materialsStatus | enum(none_needed, pending, fulfilled) | Yes | "none_needed" | Materials status |
| customerSignoffStatus | enum(not_required, pending, signed, disputed) | Yes | "not_required" | Customer signoff status |
| workSummary | string | No | — | Work summary |
| recommendedFollowup | string | No | — | Recommended followup |
| priority | enum(low, medium, high, critical) | No | "medium" | Priority |
| estimatedLaborHours | number | No | — | Estimated labor hours |
| estimatedMaterialCost | number | No | — | Estimated material cost |
| checkInAt | string.date-time | No | — | Check in at |
| checkOutAt | string.date-time | No | — | Check out at |
| gpsCheckIn | object | No | — | Gps check in |
| gpsCheckOut | object | No | — | Gps check out |
| completionNotes | string | No | — | Completion notes |
| followUpRequired | boolean | Yes | false | Follow up required |
| isRevisit | boolean | Yes | false | Is revisit |
| requiredSkills | string[] | No | — | Required skills |
| 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 |
|---|---|---|---|---|
| ticketId | string | No | — | ID of the associated ticket |
| projectId | string | No | — | ID of the associated project |
| pmScheduleId | string | No | — | ID of the associated pm schedule |
| customerId | string | No | — | ID of the associated customer |
| siteId | string | No | — | ID of the associated site |
| workType | enum(service_call, installation, inspection, preventive_maintenance, emergency, other) | No | — | Work type |
| dispatchStatus | enum(unscheduled, scheduled, dispatched, en_route, on_site, completed, canceled) | No | "unscheduled" | Dispatch status |
| scheduledStart | string.date-time | No | — | Scheduled start |
| scheduledEnd | string.date-time | No | — | Scheduled end |
| technicianUserIds | string[] | No | — | Technician user ids |
| billableStatus | enum(not_billable, billable, invoiced) | No | "not_billable" | Billable status |
| laborStatus | enum(not_started, in_progress, completed) | No | "not_started" | Labor status |
| materialsStatus | enum(none_needed, pending, fulfilled) | No | "none_needed" | Materials status |
| customerSignoffStatus | enum(not_required, pending, signed, disputed) | No | "not_required" | Customer signoff status |
| workSummary | string | No | — | Work summary |
| recommendedFollowup | string | No | — | Recommended followup |
| priority | enum(low, medium, high, critical) | No | "medium" | Priority |
| estimatedLaborHours | number | No | — | Estimated labor hours |
| estimatedMaterialCost | number | No | — | Estimated material cost |
| checkInAt | string.date-time | No | — | Check in at |
| checkOutAt | string.date-time | No | — | Check out at |
| gpsCheckIn | object | No | — | Gps check in |
| gpsCheckOut | object | No | — | Gps check out |
| completionNotes | string | No | — | Completion notes |
| followUpRequired | boolean | No | false | Follow up required |
| isRevisit | boolean | No | false | Is revisit |
| requiredSkills | string[] | No | — | Required skills |