Skip to content

Data Definition Document: Unified Workflow

Domain: Unified (audit, communications, identity, library, notifications, search, signals, vault, workflow) Logical Sub-Domain: Workflow & Requests (Ops Engine) Physical Packages: @sd/mod-unified-workflow Related Documents: Process Blueprint Context: This document defines the Data Structures for Requests, Work Orders, and the Service Catalog. Source: packages/modules/unified/workflow/src/schema.ts

0. Entity Relationship Diagram (ERD)

erDiagram
    %% Core Request
    USER ||--o{ SERVICE_REQUEST : "submits"
    SERVICE_CATALOG_ITEM ||--o{ SERVICE_REQUEST : "defines"

    %% Scaling Up
    SERVICE_REQUEST ||--|{ WORK_ORDER : "escalates_to"
    WORK_ORDER ||--|{ WORK_ORDER_ITEM : "contains"

    %% Execution
    SERVICE_GROUP ||--o{ SERVICE_REQUEST : "fulfills"
    PROVIDER_PROFILE ||--o{ WORK_ORDER : "assigned"

    SERVICE_REQUEST {
        string id PK
        enum category "maintenance, security, etc"
        enum status "submitted, in_progress, resolved"
        string serviceGroupId FK
    }

    WORK_ORDER {
        string id PK
        string parentRequestId FK
        enum status "draft, issued, completed"
    }

    SERVICE_CATALOG_ITEM {
        string id PK
        string title
        boolean requiresLastMile
        enum pricingType "fixed, estimate"
    }

1. Primary Entities

Entity: ServiceRequest

The core transactional unit - a ticket submitted by a user.

Field Type Required Description
id string Yes Unique ID.
category string Yes Enum: maintenance, security, hospitality, admin.
title string Yes Short summary.
requesterId string Yes User ID of creator.
requesterContextId string No Context ID (e.g. Unit Owner vs Guest).
serviceGroupId string No The Queue handling this (e.g. "MaintenanceTeam").
providerId string No Specific vendor assigned.
status RequestStatus Yes Flow state.
priority string Yes low, medium, high, critical.
requiresLastMile boolean No If true, triggers Concierge delivery upon resolution.

Entity: WorkOrder

A complex back-office project derived from a Request.

Field Type Required Description
id string Yes Unique ID.
parentRequestId string Yes Link to the original Resident ticket.
itemIds string[] Yes List of Line Items.
totalEstimatedCost number No Financial projection.
providerProfileId string No Vendor executing the work.

Entity: WorkOrderItem

A specific task or line item within a Work Order.

Field Type Required Description
parentWorkOrderId string Yes Link to WO.
purchaseOrderIds string[] No Links to Finance/Procurement POs.

2. Configuration Entities

Entity: ServiceCatalogItem

A menu item defining default behavior.

Field Type Required Description
pricingType string Yes fixed
requiresLastMile boolean Yes Configuration flag for auto-routing.
isFeedbackGated boolean Yes If true, user must rate before closing.

4. Changelog

Date Author Description Reference
2026-01-24 Antigravity Initial creation Implementation Plan