{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/raute-io/json-schema/raute-io-tracking-schema.json",
  "title": "Tracking",
  "description": "Where the order is, when it is expected and who is carrying it.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/raute-io-openapi.json#/components/schemas/Tracking",
  "type": "object",
  "properties": {
    "status": {
      "$ref": "#/$defs/OrderStatus"
    },
    "estimated_arrival": {
      "type": [
        "string",
        "null"
      ]
    },
    "route_index": {
      "type": [
        "integer",
        "null"
      ]
    },
    "delivered_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "proof_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "signature_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "driver": {
      "$ref": "#/$defs/Driver"
    }
  },
  "$defs": {
    "Driver": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "phone": {
          "type": [
            "string",
            "null"
          ]
        },
        "email": {
          "type": [
            "string",
            "null"
          ]
        },
        "external_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "external_source": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "OrderStatus": {
      "type": "string",
      "enum": [
        "pending",
        "assigned",
        "in_progress",
        "delivered",
        "cancelled"
      ]
    }
  }
}