{
  "type": "object",
  "title": "Route",
  "description": "A Route is the planned path for a shipment from origin to destination, potentially passing through multiple hubs and waypoints. Maps to beckn:Journey. ",
  "required": [
    "id",
    "origin",
    "destination"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique route identifier",
      "example": "RTE-BLR-DEL-001"
    },
    "name": {
      "type": "string",
      "description": "Human-readable route name",
      "example": "Bangalore to Delhi via Hyderabad"
    },
    "origin": {
      "$ref": "https://schema.nfh.global/LogisticsPlace/v2.0/schema.json"
    },
    "destination": {
      "$ref": "https://schema.nfh.global/LogisticsPlace/v2.0/schema.json"
    },
    "waypoints": {
      "type": "array",
      "description": "Intermediate waypoints/hubs on the route",
      "items": {
        "$ref": "https://schema.nfh.global/Waypoint/v2.0/schema.json"
      }
    },
    "totalDistance": {
      "type": "object",
      "properties": {
        "value": {
          "type": "number",
          "example": 2150
        },
        "unit": {
          "type": "string",
          "enum": [
            "km",
            "miles"
          ],
          "example": "km"
        }
      }
    },
    "estimatedDuration": {
      "type": "object",
      "properties": {
        "value": {
          "type": "number",
          "example": 36
        },
        "unit": {
          "type": "string",
          "enum": [
            "hours",
            "days"
          ],
          "example": "hours"
        }
      }
    },
    "transportMode": {
      "type": "string",
      "enum": [
        "ROAD",
        "AIR",
        "RAIL",
        "MULTIMODAL"
      ],
      "example": "ROAD"
    },
    "routeType": {
      "type": "string",
      "description": "Classification of route",
      "enum": [
        "HYPERLOCAL",
        "LAST_MILE",
        "FIRST_MILE",
        "LINE_HAUL",
        "CROSS_DOCKING"
      ],
      "example": "LINE_HAUL"
    },
    "geometry": {
      "type": "object",
      "description": "GeoJSON LineString of route geometry",
      "properties": {
        "type": {
          "type": "string",
          "example": "LineString"
        },
        "coordinates": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        }
      }
    },
    "tollCost": {
      "type": "number",
      "description": "Estimated toll charges in INR",
      "example": 1250
    },
    "restrictions": {
      "type": "array",
      "description": "Route restrictions (e.g. night driving ban)",
      "items": {
        "type": "string"
      },
      "example": [
        "No night driving in MP",
        "Heavy vehicle ban in city center"
      ]
    }
  },
  "$id": "https://schema.nfh.global/LogisticsRoute/v2.0",
  "x-iri": "https://schema.nfh.global/LogisticsRoute/v2.0",
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
