{
  "$schema": "http://json-schema.org/schema#",
  "type": "object",
  "properties": {
    "metadata": {
      "type": [
        "object",
        "null"
      ],
      "$ref": "#/definitions/metadata"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "header": {
            "type": "object",
            "properties": {
              "events": {
                "type": "array",
                "description": "The event(s) that triggered the message.\n\nbookingConfirmed: Share booking confirmation of transport order within planning system\nbookingUpdateConfirmed: Share update confirmation of transport order within planning system\nplanningDone: Share initial truck details with customer from planning\nplanningUpdate: Share updated truck details with customer from planning\ncancelled: Share cancellation message\npostponed: Delivery has been postponed\narrivedForFinalUnloading: Driver has arrived for final unloading\narrivedForContainerDropOff: Driver has arrived for container drop off\ndepartedFromFinalUnloading: Driver is on route from final unloading\ndepartedFromContainerDropOff: Driver is on route from container drop off\ndepartedFromOriginalLoading: Driver is on route from original loading\ndepartedFromContainerPickUp: Driver is on route from container pick up\narrivedForOriginalLoading: Driver has reported for original loading\narrivedForContainerPickUp: Driver has reported for container pick up\nstartedOriginalLoading: Loading has started at original loading\nstartedContainerPickUp: Container pick up has started\nendedOriginalLoading: Loading has ended at original loading\nendedContainerPickUp: Container pick up has ended\nstartedFinalUnloading: Unloading has started at final unloading\nstartedContainerDropOff: Container drop off has started\nendedFinalUnloading: Unloading has ended at final unloding\nendedContainerDropOff: Container drop off has ended\narrivedForHubLoading: Driver has reported for HUB loading\nstartedHubLoading: Loading has started at HUB loading\nendedHubLoading: Loading has ended  at HUB loading\ndepartedFromHubLoading: Driver is on route from HUB loading\narrivedForHubUnloading: Driver has arrived for HUB unloading\nstartedHubUnloading: Unloading has started at HUB unloding\nendedHubUnloading: Unloading has ended at HUB unloding\ndepartedFromHubUnloading: Driver is on route from HUB Unloading\nstartedTrainTransport: Train has departed from the terminal\nendedTrainTransport: Train has arrived at the terminal\nstartedConnection: Connection has departed from the terminal\nendedConnection: Connection has arrived at the terminal\nalertHandling: Alerts are being handled\nalertDelayedOriginalLoading: The system predicts the required original loading date/time will not be met.\nalertDelayedContainerPickUp: The system predicts the required container pick up date/time will not be met.\nalertDelayedFinalUnloading: The system predicts the required final unloading date/time will not be met.\nalertDelayedContainerDropOff: The system predicts the required container drop off date/time will not be met.\navoidedDelayedOriginalLoading: A prevously predicted delayed original loading will not happen; original timeframe will be kept.\navoidedDelayedContainerPickUp: A prevously predicted delayed container pick up will not happen; original timeframe will be kept.\navoidedDelayedFinalUnloading: A prevously predicted delayed final unloading will not happen; original timeframe will be kept.\navoidedDelayedContainerDropOff: A prevously predicted delayed container drop off will not happen; original timeframe will be kept.\ncompleted: Shipment is fully done, including administration tasks",
                "items": {
                  "type": "string",
                  "enum": [
                    "bookingConfirmed",
                    "bookingUpdateConfirmed",
                    "planningDone",
                    "planningUpdate",
                    "cancelled",
                    "postponed",
                    "arrivedForFinalUnloading",
                    "arrivedForContainerDropOff",
                    "departedFromFinalUnloading",
                    "departedFromContainerDropOff",
                    "departedFromOriginalLoading",
                    "departedFromContainerPickUp",
                    "arrivedForOriginalLoading",
                    "arrivedForContainerPickUp",
                    "startedOriginalLoading",
                    "startedContainerPickUp",
                    "endedOriginalLoading",
                    "endedContainerPickUp",
                    "startedFinalUnloading",
                    "startedContainerDropOff",
                    "endedFinalUnloading",
                    "endedContainerDropOff",
                    "arrivedForHubLoading",
                    "startedHubLoading",
                    "endedHubLoading",
                    "departedFromHubLoading",
                    "arrivedForHubUnloading",
                    "startedHubUnloading",
                    "endedHubUnloading",
                    "departedFromHubUnloading",
                    "startedTrainTransport",
                    "endedTrainTransport",
                    "startedConnection",
                    "endedConnection",
                    "alertHandling",
                    "alertDelayedOriginalLoading",
                    "alertDelayedContainerPickUp",
                    "alertDelayedFinalUnloading",
                    "alertDelayedContainerDropOff",
                    "avoidedDelayedOriginalLoading",
                    "avoidedDelayedContainerPickUp",
                    "avoidedDelayedFinalUnloading",
                    "avoidedDelayedContainerDropOff",
                    "completed"
                  ]
                }
              },
              "status": {
                "type": "string",
                "description": "The current status of the item. In case of a status change, this will be the NEW status.",
                "enum": [
                  "booked",
                  "prePlanned",
                  "planned",
                  "loading",
                  "inOperation",
                  "unloading",
                  "delivered",
                  "cancelled",
                  "completed"
                ]
              },
              "statusNumber": {
                "type": "integer",
                "description": "Numeric value matching the status. Can be used to easily do 'before status x' or 'after status y' logic since the numbering matches the normal chronological order.\nbooked: 0\nprePlanned: 10\nplanned: 20\nloading: 30\ninOperation: 40\nunloading: 50\ndelivered: 60\ncancelled: 70\ncompleted: 90",
                "enum": [
                  0,
                  10,
                  20,
                  30,
                  40,
                  50,
                  60,
                  70,
                  90
                ]
              }
            },
            "required": [
              "events",
              "status",
              "statusNumber"
            ]
          },
          "shipment": {
            "$ref": "#/definitions/shipment"
          },
          "leg": {
            "$ref": "#/definitions/leg"
          },
          "mainActivities": {
            "$ref": "#/definitions/mainActivities"
          },
          "alerts": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "isNew": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "id": {
                  "type": "string"
                },
                "systemTime": {
                  "type": "string",
                  "format": "date-time"
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "reasonCode": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "remark": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "communicatedTimeLoad": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "communicatedTimeUnload": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                }
              },
              "required": [
                "type",
                "id",
                "systemTime"
              ]
            }
          }
        },
        "required": [
          "header",
          "shipment",
          "mainActivities"
        ]
      }
    },
    "$schema": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "Url to the schema used for validation. This can be filled in to let certain editors validate the contents based on the schema. The integration setup will ignore it. Possible values are the schema links a the top of the documentation page."
    }
  },
  "required": [
    "events"
  ],
  "definitions": {
    "metadata": {
      "properties": {
        "source": {
          "type": [
            "string",
            "null"
          ],
          "description": "Source system or customer code."
        },
        "messageId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Unique id for the message."
        },
        "messageReference": {
          "type": [
            "string",
            "null"
          ],
          "description": "Customer reference for the message."
        },
        "messageType": {
          "type": [
            "string",
            "null"
          ],
          "description": "Type name of the message."
        },
        "messageRootId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Message id of the first message in a chain of messages."
        },
        "timeStamp": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Date and time the message was generated. If time zone information is omitted, is UTC."
        }
      }
    },
    "measurement": {
      "properties": {
        "grossWeight": {
          "type": [
            "number",
            "null"
          ],
          "description": "Kilograms.",
          "multipleOf": 0.001
        },
        "quantity": {
          "type": [
            "number",
            "null"
          ],
          "multipleOf": 0.001
        },
        "volume": {
          "type": [
            "number",
            "null"
          ],
          "multipleOf": 0.001,
          "description": "Cubic metres."
        },
        "volumeWeight": {
          "type": [
            "number",
            "null"
          ],
          "multipleOf": 0.001,
          "description": "Kilograms. Usually only used for air freight."
        },
        "loadIndex": {
          "type": [
            "number",
            "null"
          ],
          "multipleOf": 0.001
        },
        "palletPlaces": {
          "type": [
            "number",
            "null"
          ],
          "multipleOf": 0.001
        }
      }
    },
    "dimensions": {
      "properties": {
        "length": {
          "type": [
            "number",
            "null"
          ],
          "multipleOf": 0.001,
          "description": "Metres."
        },
        "width": {
          "type": [
            "number",
            "null"
          ],
          "multipleOf": 0.001,
          "description": "Metres."
        },
        "height": {
          "type": [
            "number",
            "null"
          ],
          "multipleOf": 0.001,
          "description": "Metres."
        }
      }
    },
    "cargoLine": {
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ]
        },
        "mark": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 50
        },
        "packageType": {
          "type": [
            "string"
          ],
          "enum": [
            "uld16Feet",
            "uld20Feet",
            "container20Feet",
            "container20FeetReefer",
            "container40Feet",
            "container45Feet",
            "container45FeetHighCube",
            "aap",
            "ake",
            "bag",
            "pallet",
            "box",
            "containerCcTag5",
            "containerCc",
            "chepEuroPallet",
            "colli",
            "chepPallet",
            "crate",
            "carton",
            "containerDc",
            "deciMeterLoadIndex",
            "airplaneEngine",
            "euroPallet",
            "oneWayPallet",
            "extention",
            "flowPallet",
            "container40FeetHighCube",
            "helicopter",
            "halfPlanePlate",
            "container40FeetReefer",
            "horizontalStack",
            "ibc",
            "industrialPallet",
            "kilograms",
            "load",
            "meterLoadIndex",
            "cubicMeter",
            "shipment",
            "batch",
            "hour",
            "week",
            "shelveLocation",
            "otherPalletType",
            "piece",
            "planePlateLoose",
            "planePlate",
            "rollContainer217LoadIndex",
            "rollContainer240LoadIndex",
            "rollContainer278LoadIndex",
            "rollContainer233LoadIndex",
            "reefer",
            "roadTrain",
            "shelves",
            "skid",
            "stack",
            "truck",
            "trailer",
            "uld",
            "wingPlate",
            "multiple"
          ]
        },
        "measurement": {
          "type": [
            "object"
          ],
          "$ref": "#/definitions/measurement"
        },
        "goodsType": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            null,
            "airCargo",
            "airCargoPalletized",
            "alcohol",
            "aluminium",
            "beer",
            "carParts",
            "ceramics",
            "cheese",
            "chemicals",
            "chocolate",
            "cigarettes",
            "computerParts",
            "consumerElectronics",
            "cosmetics",
            "empty",
            "flowers",
            "food",
            "fruit",
            "furniture",
            "general",
            "glass",
            "householdArticles",
            "lighting",
            "liquor",
            "machines",
            "mail",
            "meat",
            "medicalEquipment",
            "motorGp",
            "nickel",
            "paint",
            "paper",
            "perishables",
            "pharmaceuticals",
            "plants",
            "plastics",
            "shoes",
            "solarPanels",
            "textile",
            "tobacco",
            "toys",
            "vegetables",
            "packingMaterials",
            "wine",
            "wood"
          ]
        },
        "goodsDescription": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 20
        }
      },
      "additionalProperties": true,
      "required": [
        "packageType",
        "measurement"
      ]
    },
    "detailLine": {
      "allOf": [
        {
          "$ref": "#/definitions/cargoLine"
        },
        {
          "properties": {
            "awb": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^[0-9]{3}[-][0-9]{8}$",
              "maxLength": 12
            },
            "packDescription": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "additionalProperties": true
        }
      ]
    },
    "goodsLine": {
      "allOf": [
        {
          "$ref": "#/definitions/cargoLine"
        },
        {
          "properties": {
            "packageDescription": {
              "type": [
                "string",
                "null"
              ]
            },
            "dimensions": {
              "type": [
                "object",
                "null"
              ],
              "$ref": "#/definitions/dimensions"
            },
            "detailLines": {
              "type": [
                "array",
                "null"
              ],
              "description": "Further breakdown of the goods. If this was not provided when the shipment was created, there will be a single detail line for each goods line.",
              "items": {
                "type": "object",
                "$ref": "#/definitions/detailLine"
              }
            },
            "dangerousGoods": {
              "type": [
                "array",
                "null"
              ],
              "maxItems": 1,
              "items": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "maxLength": 4,
                    "pattern": "^[0-9]{1,4}$",
                    "description": "UN code."
                  },
                  "suffix": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 3,
                    "pattern": "^[0-9]{1,3}$"
                  },
                  "tunnelCode": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          },
          "additionalProperties": true
        }
      ]
    },
    "address": {
      "properties": {
        "locationCode": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 100,
          "description": "In case the location is an airport, this will be the IATA code."
        },
        "name1": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 100
        },
        "line1": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 100,
          "description": "Street name and number."
        },
        "city": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 100
        },
        "postalCode": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 10
        },
        "countryName": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 100
        },
        "countryCode": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2,
          "pattern": "^[A-Z]{2}$",
          "description": "ISO-2 country code."
        },
        "longitude": {
          "type": [
            "number",
            "null"
          ]
        },
        "latitude": {
          "type": [
            "number",
            "null"
          ]
        }
      }
    },
    "contact": {
      "properties": {
        "emailDetails": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "normal"
                ]
              },
              "value": {
                "type": "string",
                "description": "E-mail address."
              }
            },
            "required": [
              "type",
              "value"
            ]
          }
        },
        "telephoneDetails": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "normal"
                ]
              },
              "value": {
                "type": "string",
                "description": "Phone number."
              }
            },
            "required": [
              "type",
              "value"
            ]
          }
        },
        "faxNumber": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "party": {
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "number": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[0-9]{6}$",
          "maxLength": 6,
          "description": "Jan de Rijk number of the existing party in Jan de Rijk system."
        },
        "code": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 20,
          "description": "Jan de Rijk code of the existing party in Jan de Rijk system."
        },
        "address": {
          "type": "object",
          "$ref": "#/definitions/address"
        },
        "contact": {
          "type": [
            "object",
            "null"
          ],
          "$ref": "#/definitions/contact"
        },
        "remarks": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "address"
      ],
      "additionalProperties": false
    },
    "dateTimeWindow": {
      "description": "Estimated date/time of relevant events. Actual date/time if the event has already happened.",
      "properties": {
        "opening": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Includes time zone indicator."
        },
        "closing": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Includes time zone indicator."
        }
      }
    },
    "dateTimewindowWithEarlyPossible": {
      "allOf": [
        {
          "$ref": "#/definitions/dateTimeWindow"
        },
        {
          "properties": {
            "earlyPossible": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        }
      ]
    },
    "milestones": {
      "description": "Actual date/time of relevant events. null if the event did not yet happen.",
      "properties": {
        "arrival": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Includes time zone indicator."
        },
        "start": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Includes time zone indicator."
        },
        "end": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Includes time zone indicator."
        }
      }
    },
    "shipment": {
      "type": "object",
      "minItems": 1,
      "properties": {
        "number": {
          "type": "string",
          "pattern": "^(([0-9]{12})|([0-9]{15}))$",
          "description": "Internal Jan de Rijk number for the original order of the customer."
        },
        "ediReference": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 27,
          "description": "Customer unique id for the shipment, as delivered in the inbound EDI. Null for items that were not delivered via EDI."
        },
        "order": {
          "type": "object",
          "properties": {
            "number": {
              "type": "string",
              "pattern": "^(([0-9]{12})|([0-9]{15}))$",
              "description": "Internal Jan de Rijk number for the original order of the customer."
            },
            "reference": {
              "type": "string",
              "maxLength": 30,
              "description": "Customer's reference for the order. This is the reference that would be used to refer to the order in any communication between the customer and Jan de Rijk. Comes from transportorder-main: $.orders."
            },
            "departmentCode": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^[0-9]{3}$",
              "maxLength": 3,
              "description": "The code of the Jan de Rijk department handling the order."
            },
            "product": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "generalCargo",
                "importContainers",
                "exportContainers",
                null
              ],
              "description": "The Jan de Rijk product relevant for the order."
            },
            "customer": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "maxLength": 100
                },
                "code": {
                  "type": "string",
                  "description": "Jan de Rijk code for the customer.",
                  "maxLength": 20
                }
              },
              "required": [
                "name",
                "code"
              ]
            },
            "ediReference": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 27,
              "description": "Customer unique id for the order, as delivered in the inbound EDI. Null for items that were not delivered via EDI."
            },
            "customerData": {
              "type": [
                "object",
                "null"
              ],
              "description": "The customer specific data as delivered with the transport order file.",
              "additionalProperties": true
            }
          },
          "required": [
            "number",
            "reference",
            "customer"
          ]
        },
        "creationDateTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Includes time zone indicator."
        },
        "reference": {
          "type": "string",
          "maxLength": 30,
          "description": "Customer's reference for the shipment. This is the reference that would be used to refer to the order in any communication between the customer and Jan de Rijk. This reference also appears on invoices and status messages, and is searchable in JConnect."
        },
        "requirements": {
          "type": "object",
          "description": "Special requirements relating to the shipment.",
          "properties": {
            "freightUnitType": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                null,
                "flatBox",
                "box",
                "isolation",
                "tautliner",
                "semiLowloader",
                "lowloader",
                "container",
                "chassis",
                "walkingFloor",
                "unspecified"
              ]
            },
            "roadTrain": {
              "type": "boolean"
            },
            "walkingFloor": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "mega": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "taillift": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "crane": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "kooiaap": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "palletTruck": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "reefer": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "doubleFloor": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "dangerousCargo": {
              "type": "boolean",
              "description": "This means LZV (longer truck)."
            },
            "urgent": {
              "type": "boolean"
            },
            "heater": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "cooler": {
              "type": "boolean"
            },
            "palletSwap": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "gdp": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "exclusive": {
              "type": "boolean",
              "description": "If true, Jan de Rijk won't co-load the cargo with other customers' cargo. Co-loading regulations are taken into account regardless."
            },
            "timeCriticalLoading": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "timeCriticalUnloading": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "customsDocument": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "chassisTypes": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string"
              }
            },
            "customsDocumentTypes": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string"
              }
            },
            "maximumTemperature": {
              "type": [
                "number",
                "null"
              ]
            },
            "minimumTemperature": {
              "type": [
                "number",
                "null"
              ]
            },
            "temperatureSetPoint": {
              "type": [
                "number",
                "null"
              ]
            },
            "pharmaceuticals": {
              "type": [
                "boolean",
                "null"
              ],
              "description": "It concerns pharmaceutical cargo, and all requirements for that apply."
            },
            "secondDriver": {
              "type": [
                "boolean",
                "null"
              ],
              "description": "The truck should be double manned."
            },
            "standBy": {
              "type": [
                "boolean",
                "null"
              ],
              "description": "Reserve capacity for last minute order updates."
            }
          },
          "required": [
            "roadTrain",
            "dangerousCargo",
            "urgent",
            "cooler",
            "exclusive"
          ]
        },
        "security": {
          "type": "object",
          "description": "Specifies security above the standard security level of TSR 01. The actual security level is explained in the SOP and arranged by the Jan de Rijk planning team.",
          "properties": {
            "containerLock": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "guidance": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "secured": {
              "type": "boolean"
            },
            "level": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                null,
                "TAPA1",
                "TAPA2"
              ]
            }
          },
          "required": [
            "secured"
          ]
        },
        "transportInstructions": {
          "type": [
            "string",
            "null"
          ]
        },
        "generalInstructions": {
          "type": [
            "string",
            "null"
          ]
        },
        "measurement": {
          "type": "object",
          "$ref": "#/definitions/measurement"
        },
        "goodsLines": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/goodsLine"
          }
        },
        "customerData": {
          "type": [
            "object",
            "null"
          ],
          "description": "The customer specific data as delivered with the transport order file.",
          "additionalProperties": true
        },
        "remarks": {
          "type": [
            "string",
            "null"
          ]
        },
        "clearingIn": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "party": {
              "type": [
                "object",
                "null"
              ],
              "$ref": "#/definitions/party"
            }
          }
        },
        "clearingOut": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "party": {
              "type": [
                "object",
                "null"
              ],
              "$ref": "#/definitions/party"
            }
          }
        },
        "containerPickUp": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "party": {
              "type": "object",
              "$ref": "#/definitions/party"
            },
            "dateTimes": {
              "type": "object",
              "$ref": "#/definitions/dateTimeWindow"
            },
            "reference": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "dateTimes",
            "party"
          ]
        },
        "originalLoading": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "party": {
              "type": "object",
              "$ref": "#/definitions/party"
            },
            "dateTimes": {
              "type": "object",
              "$ref": "#/definitions/dateTimeWindow"
            },
            "reference": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "dateTimes",
            "party"
          ]
        },
        "finalUnloading": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "party": {
              "type": "object",
              "$ref": "#/definitions/party"
            },
            "dateTimes": {
              "type": [
                "object",
                "null"
              ],
              "$ref": "#/definitions/dateTimewindowWithEarlyPossible"
            },
            "reference": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "dateTimes",
            "party"
          ]
        },
        "containerDropOff": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "party": {
              "type": "object",
              "$ref": "#/definitions/party"
            },
            "dateTimes": {
              "type": "object",
              "$ref": "#/definitions/dateTimewindowWithEarlyPossible"
            },
            "reference": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "dateTimes",
            "party"
          ]
        },
        "container": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "number": {
              "type": [
                "null",
                "string"
              ]
            },
            "type": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "documents": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "reference": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      },
      "required": [
        "number",
        "order",
        "reference",
        "requirements",
        "security",
        "goodsLines",
        "measurement"
      ]
    },
    "leg": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "tripId": {
          "type": [
            "string",
            "null"
          ]
        },
        "vehicle": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "id": {
              "description": "Jan de Rijk ID.",
              "type": [
                "string",
                "null"
              ]
            },
            "licensePlate": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "drivers": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "description": "Jan de Rijk ID.",
                "type": "string"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "hasAdrLicense": {
                "type": [
                  "boolean",
                  "null"
                ]
              }
            },
            "required": [
              "id"
            ]
          }
        },
        "pulledUnit": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "id": {
              "description": "Jan de Rijk ID.",
              "type": [
                "string",
                "null"
              ]
            },
            "licensePlate": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "freightUnits": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "description": "Jan de Rijk ID.",
                "type": "string"
              },
              "condition": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "temperatures": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "object",
                      "properties": {
                        "sensorKey": {
                          "type": "string",
                          "enum": [
                            "lowest",
                            "highest"
                          ]
                        },
                        "value": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "sensorKey",
                        "value"
                      ]
                    }
                  }
                }
              }
            },
            "required": [
              "id"
            ]
          }
        }
      }
    },
    "mainActivities": {
      "type": "object",
      "properties": {
        "containerPickUp": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "dateTimes": {
              "type": [
                "object",
                "null"
              ],
              "$ref": "#/definitions/milestones"
            },
            "milestones": {
              "type": [
                "object",
                "null"
              ],
              "$ref": "#/definitions/milestones"
            }
          }
        },
        "originalLoading": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "dateTimes": {
              "type": [
                "object",
                "null"
              ],
              "$ref": "#/definitions/milestones"
            },
            "milestones": {
              "type": [
                "object",
                "null"
              ],
              "$ref": "#/definitions/milestones"
            }
          }
        },
        "finalUnloading": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "dateTimes": {
              "type": [
                "object",
                "null"
              ],
              "$ref": "#/definitions/milestones"
            },
            "milestones": {
              "type": [
                "object",
                "null"
              ],
              "$ref": "#/definitions/milestones"
            }
          }
        },
        "containerDropOff": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "dateTimes": {
              "type": [
                "object",
                "null"
              ],
              "$ref": "#/definitions/milestones"
            },
            "milestones": {
              "type": [
                "object",
                "null"
              ],
              "$ref": "#/definitions/milestones"
            }
          }
        }
      }
    }
  }
}