{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schemas.ruter.no/adt/ota/api/v4.x/pe/sales/current_stop/sales-current_stop.json",
  "type": "object",
  "title": "SalesCurrentStop",
  "required": [
    "eventTimestamp",
    "traceId",
    "progressRef",
    "vehicleRef",
    "stopPlaceId",
    "tariffZones"
  ],
  "additionalProperties": false,
  "properties": {
    "eventTimestamp": {
      "$id": "#/properties/eventTimestamp",
      "type": "string",
      "description": "Time of the Progress event",
      "format": "date-time"
    },
    "traceId": {
      "$id": "#/properties/traceId",
      "$comment": "Added in version 2.5",
      "type": "string",
      "description": "A unique identifier to be able to trace this message. Also used to detect duplicate messages received."
    },
    "spanId": {
      "$id": "#/properties/spanId",
      "type": "string",
      "description": "A unique identifier for an individual step of a transaction. Consists of the spanId from the current_stop message and a new UUID for this step, separated by a colon."
    },
    "progressRef": {
      "$id": "#/properties/progressRef",
      "type": "string",
      "description": "A reference to the Progress event that triggered this message. Matches the traceId from the Progress event."
    },
    "actualCallRef": {
      "$id": "#/properties/actualCallRef",
      "type": "string",
      "description": "A reference to actualCallRef on the Progress event that triggered this message. This is necessary because some journeys serve the same stopPlaceId twice"
    },
    "journeyRef": {
      "$id": "#/properties/journeyRef",
      "type": "string",
      "description": "JourneyRef from the Progress event"
    },
    "vehicleRef": {
      "$id": "#/properties/vehicleRef",
      "type": "string",
      "description": "The vehicleRef (VIN) for the vehicle that sent the Progress event"
    },
    "assignmentRef": {
      "$id": "#/properties/assignmentRef",
      "type": "string",
      "description": "AssignmentRef from the Progress event"
    },
    "chainId": {
      "$id": "#/properties/chainId",
      "type": "string",
      "description": "The chainId for the operator that owns the vehicle"
    },
    "lineRef": {
      "$id": "#/properties/lineRef",
      "type": "string",
      "description": "LineRef the bus is operating currently, obtained from the Progress event"
    },
    "lineName": {
      "$id": "#/properties/lineName",
      "type": "string",
      "description": "Name of the line the bus is operating currently"
    },
    "blockId": {
      "$id": "#/properties/blockId",
      "type": "string",
      "description": "BlockId from the Progress event"
    },
    "quayId": {
      "$id": "#/properties/quayId",
      "type": "string",
      "description": "QuayId from the Progress event"
    },
    "stopPlaceId": {
      "$id": "#/properties/stopPlaceId",
      "type": "string",
      "description": "StopPlaceId the Progress event was received for"
    },
    "tariffZones": {
      "$id": "#/properties/tariffZones",
      "type": "object",
      "description": "Tariff zone object for the current and next stops",
      "required": [
        "onCurrentStop",
        "onNextStop"
      ],
      "additionalProperties": true,
      "properties": {
        "onCurrentStop": {
          "$id": "#/properties/tariffZones/properties/onCurrentStop",
          "type": "object",
          "description": "Zone object for the current stop",
          "required": [
            "id",
            "name",
            "nodId",
            "fareZoneId"
          ],
          "additionalProperties": true,
          "properties": {
            "id": {
              "$id": "#/properties/tariffZones/properties/onCurrentStop/properties/id",
              "type": "string",
              "description": "The PTA zone id, like RUT:TariffZone:228"
            },
            "name": {
              "$id": "#/properties/tariffZones/properties/onCurrentStop/properties/name",
              "type": "string",
              "description": "Name of the zone, like 2S"
            },
            "nodId": {
              "$id": "#/properties/tariffZones/properties/onCurrentStop/properties/nodId",
              "type": "string",
              "description": "The NOD zone id, like 228"
            },
            "fareZoneId": {
              "$id": "#/properties/tariffZones/properties/onCurrentStop/properties/fareZoneId",
              "type": "string",
              "description": "The Entur zone id, like RUT:FareZone:10"
            }
          }
        },
        "onNextStop": {
          "$id": "#/properties/tariffZones/properties/onNextStop",
          "type": "object",
          "description": "Zone object for the current stop",
          "required": [
            "id",
            "name",
            "nodId",
            "fareZoneId"
          ],
          "additionalProperties": true,
          "properties": {
            "id": {
              "$id": "#/properties/tariffZones/properties/onNextStop/properties/id",
              "type": "string",
              "description": "The PTA zone id, like RUT:TariffZone:228"
            },
            "name": {
              "$id": "#/properties/tariffZones/properties/onNextStop/properties/name",
              "type": "string",
              "description": "Name of the zone, like 2S"
            },
            "nodId": {
              "$id": "#/properties/tariffZones/properties/onNextStop/properties/nodId",
              "type": "string",
              "description": "The NOD zone id, like 228"
            },
            "fareZoneId": {
              "$id": "#/properties/tariffZones/properties/onNextStop/properties/fareZoneId",
              "type": "string",
              "description": "The Entur zone id, like RUT:FareZone:10"
            }
          }
        }
      }
    }
  }
}
