{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/steadywrk-app/json-schema/steadywrk-app-order-response-schema.json",
  "title": "OrderResponse",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/steadywrk-app-openapi.json#/components/schemas/OrderResponse",
  "type": "object",
  "required": [
    "created",
    "accepted",
    "fulfilled",
    "order",
    "tracking"
  ],
  "properties": {
    "created": {
      "type": "boolean",
      "const": true
    },
    "accepted": {
      "type": "boolean",
      "const": true
    },
    "fulfilled": {
      "type": "boolean"
    },
    "order": {
      "type": "object",
      "required": [
        "id",
        "status",
        "trade",
        "location",
        "urgency",
        "quoted_cost_cents",
        "assigned_contractor_ref",
        "estimated_response_minutes",
        "created_at"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending_dispatch",
            "accepted_pending_fulfilment"
          ]
        },
        "trade": {
          "type": "string"
        },
        "location": {
          "type": "object",
          "required": [
            "state"
          ],
          "properties": {
            "state": {
              "type": "string"
            }
          }
        },
        "urgency": {
          "type": "string",
          "enum": [
            "emergency",
            "urgent",
            "routine",
            "scheduled"
          ]
        },
        "quoted_cost_cents": {
          "type": [
            "integer",
            "null"
          ]
        },
        "quoted_cost_usd": {
          "type": [
            "string",
            "null"
          ]
        },
        "assigned_contractor_ref": {
          "type": [
            "string",
            "null"
          ]
        },
        "estimated_response_minutes": {
          "type": [
            "integer",
            "null"
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "fulfilment": {
      "type": "object",
      "required": [
        "assigned",
        "reason",
        "detail",
        "escalation_contact"
      ],
      "properties": {
        "assigned": {
          "type": "boolean",
          "const": false
        },
        "reason": {
          "type": "string"
        },
        "detail": {
          "type": "string"
        },
        "escalation_contact": {
          "type": "string"
        }
      }
    },
    "tracking": {
      "type": "object",
      "required": [
        "status_url"
      ],
      "properties": {
        "status_url": {
          "type": "string",
          "format": "uri"
        },
        "auth": {
          "type": "string"
        }
      }
    }
  }
}