{
  "$id": "https://schema.nfh.global/TripUpdate/v2.0",
  "x-iri": "https://schema.nfh.global/TripUpdate/v2.0",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "TripUpdate",
  "type": "object",
  "description": "A multi-dimensional update to an in-progress or upcoming mobility trip, covering contract modifications (added/removed services, route changes), status notifications (driver arriving, trip started), and real-time tracking endpoint information.",
  "properties": {
    "contractChanges": {
      "description": "Items added or modified in the trip contract (new stop, route change, add-on service)",
      "$ref": "https://schema.nfh.global/ContractItem/v2.0/schema.json"
    },
    "cancelledItems": {
      "description": "Items removed from the original trip contract",
      "$ref": "https://schema.nfh.global/ContractItem/v2.0/schema.json"
    },
    "stateUpdate": {
      "description": "Status notification for the traveler (e.g. driver arriving, trip started, trip ended, driver changed)",
      "$ref": "https://schema.nfh.global/State/v2.0/schema.json"
    },
    "trackingEndpoint": {
      "description": "Real-time tracking endpoint including URL, protocol, and data schema reference",
      "$ref": "https://schema.nfh.global/Tracking/v2.1/schema.json"
    },
    "driverRef": {
      "description": "Reference to the current driver if changed from the originally assigned driver",
      "$ref": "https://schema.nfh.global/Driver/v2.0/schema.json"
    },
    "updatedAt": {
      "description": "Timestamp when this trip update was issued",
      "type": "string",
      "format": "date-time"
    },
    "id": {
      "description": "Unique identifier for the trip update",
      "type": "string"
    },
    "descriptor": {
      "description": "Human-readable description of the trip update",
      "$ref": "https://schema.nfh.global/Descriptor/v2.1/schema.json"
    }
  },
  "additionalProperties": false,
  "x-tags": [
    "mobility",
    "ride-hailing"
  ]
}
