{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/digitraffic-fi/json-schema/digitraffic-fi-visit-model-schema.json",
  "title": "VisitModel",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/digitraffic-fi-marine-api-openapi.yml#/components/schemas/VisitModel",
  "required": [
    "eta",
    "portOfCall",
    "status",
    "updateTime",
    "visitId"
  ],
  "type": "object",
  "properties": {
    "previousPortName": {
      "type": "string",
      "description": "Previous port name"
    },
    "shipCallSign": {
      "maxLength": 7,
      "type": "string",
      "description": "Ship call sign"
    },
    "breadth": {
      "maximum": 9007199254740991,
      "minimum": 0,
      "type": "integer",
      "description": "Vessel breadth in metres"
    },
    "portOfCall": {
      "maxLength": 5,
      "minLength": 5,
      "type": "string",
      "description": "Port locode of visit"
    },
    "mmsi": {
      "maxLength": 9,
      "minLength": 9,
      "pattern": "^[0-9]{9}$",
      "type": "string",
      "description": "Ship MMSI number"
    },
    "grossTonnage": {
      "maximum": 9007199254740991,
      "minimum": 0,
      "type": "integer",
      "description": "Gross tonnage (GT)"
    },
    "declarantName": {
      "maxLength": 70,
      "type": "string",
      "description": "Declarant name"
    },
    "netTonnage": {
      "maximum": 9007199254740991,
      "minimum": 0,
      "type": "integer",
      "description": "Net tonnage (NT)"
    },
    "portName": {
      "type": "string",
      "description": "Port of call name"
    },
    "berthCode": {
      "type": "string",
      "description": "Unique berth code, if available"
    },
    "berthName": {
      "type": "string",
      "description": "Berth or mooring place, if available"
    },
    "ata": {
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
      "type": "string",
      "description": "Actual time of arrival",
      "format": "date-time"
    },
    "vesselId": {
      "maxLength": 7,
      "minLength": 7,
      "type": "string",
      "description": "IMO-number"
    },
    "atd": {
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
      "type": "string",
      "description": "Actual time of departure",
      "format": "date-time"
    },
    "eta": {
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
      "type": "string",
      "description": "Estimated time of arrival",
      "format": "date-time"
    },
    "visitId": {
      "maxLength": 35,
      "type": "string"
    },
    "etd": {
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
      "type": "string",
      "description": "Estimated time of departure",
      "format": "date-time"
    },
    "height": {
      "maximum": 9007199254740991,
      "minimum": 0,
      "type": "integer",
      "description": "Vessel height in metres"
    },
    "nextPortOfCall": {
      "maxLength": 5,
      "type": "string",
      "description": "Next port (UN/LOCODE)"
    },
    "portAreaCode": {
      "type": "string",
      "description": "Port area code, if available"
    },
    "length": {
      "maximum": 9007199254740991,
      "minimum": 0,
      "type": "integer",
      "description": "Vessel length in metres"
    },
    "updateTime": {
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
      "type": "string",
      "description": "When visit was updated",
      "format": "date-time"
    },
    "previousPortOfCall": {
      "maxLength": 5,
      "type": "string",
      "description": "Previous port (UN/LOCODE)"
    },
    "vesselType": {
      "maxLength": 4,
      "type": "string",
      "description": "Vessel type code (UN/ECE Recommendation 28)"
    },
    "portAreaName": {
      "type": "string",
      "description": "Port area name, if available"
    },
    "vesselName": {
      "maxLength": 70,
      "type": "string",
      "description": "Vessel name"
    },
    "nextPortName": {
      "type": "string",
      "description": "Next port name"
    },
    "status": {
      "type": "string",
      "description": "Visit status",
      "enum": [
        "Expected to Arrive",
        "Arrived",
        "Departed",
        "Cancelled"
      ]
    }
  },
  "additionalProperties": false
}