{
  "$id": "https://schema.nfh.global/Trip/v2.0",
  "x-iri": "https://schema.nfh.global/Trip/v2.0",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Trip",
  "type": "object",
  "description": "A confirmed and booked journey from an origin to a destination, representing a completed mobility service order.",
  "properties": {
    "tripId": {
      "description": "Unique identifier for the trip",
      "type": "string"
    },
    "origin": {
      "description": "Pickup location",
      "$ref": "https://schema.nfh.global/Location/v2.0/schema.json"
    },
    "destination": {
      "description": "Dropoff location",
      "$ref": "https://schema.nfh.global/Location/v2.0/schema.json"
    },
    "startTime": {
      "description": "Actual start time of the trip",
      "type": "string",
      "format": "date-time"
    },
    "endTime": {
      "description": "Actual end time of the trip",
      "type": "string",
      "format": "date-time"
    },
    "distance": {
      "description": "Total distance of the trip in kilometres",
      "type": "number"
    },
    "driverRef": {
      "description": "Reference to the driver for this trip",
      "$ref": "https://schema.nfh.global/Driver/v2.0/schema.json"
    },
    "vehicleRef": {
      "description": "Reference to the vehicle for this trip",
      "$ref": "https://schema.nfh.global/Vehicle/v2.0/schema.json"
    },
    "id": {
      "description": "Unique identifier for the trip",
      "type": "string"
    },
    "descriptor": {
      "description": "Human-readable description of the trip",
      "$ref": "https://schema.nfh.global/Descriptor/v2.1/schema.json"
    }
  },
  "additionalProperties": false,
  "x-tags": [
    "mobility",
    "ride-hailing"
  ]
}
