{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "$id": "https://schema.123lease.nl/draft-02/vehicle",
  "title": "Voertuig",
  "description": "Een door Hexon gecommuniceerd voertuig",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "meta",
    "customer",
    "vehicle"
  ],
  "properties": {
    "$schema": {
      "type": "string",
      "format": "uri"
    },
    "meta": {
      "title": "Metadata",
      "description": "Informatie over de aanvraag zelf",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "version",
        "action"
      ],
      "properties": {
        "version": {
          "title": "Feed version",
          "description": "De versie van de feed, te gebruiken voor validatie",
          "type": "string",
          "const": "2.13"
        },
        "action": {
          "title": "Feed action",
          "description": "De uit-te-voeren actie met de auto in de feed",
          "type": "string",
          "enum": [
            "add",
            "change",
            "delete"
          ]
        }
      }
    },
    "customer": {
      "title": "Customer data",
      "description": "Informatie over de autodealer die de auto aanbied",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "$ref": "#/definitions/positiveInteger"
        }
      }
    },
    "vehicle": {
      "title": "Voertuig data",
      "description": "Informatie over het voertuig zelf",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "$ref": "#/definitions/positiveInteger"
        },
        "licensePlate": {
          "title": "Kentekenplaat van het voertuig",
          "description": "Het kenteken van het voertuig, zonder opmaak of streepjes",
          "$ref": "#/definitions/optionalString"
        },
        "brand": {
          "title": "Merk van het voertuig",
          "description": "Het merk van het voertuig, met eventuele streepjes e.d.",
          "type": "string"
        },
        "model": {
          "title": "Model van het voertuig",
          "description": "De minst specifieke omschrijving van het model",
          "type": "string"
        },
        "type": {
          "title": "Type / uitvoering van het voertuig",
          "description": "Het type of de uitvoering van het voertuig, waarmee het zich onderscheid binnen het merk + model",
          "type": "string"
        },
        "suffix": {
          "title": "Extra informatie van het voertuig",
          "description": "De extra informatie uit de titel van het voertuig, zoals bijzondere eigenschappen",
          "$ref": "#/definitions/optionalString"
        },
        "vehicleKind": {
          "title": "Soort voertuig",
          "type": "string",
          "enum": [
            "AUTO",
            "BEDRIJF",
            "MOTOR",
            "BROMFIETS",
            "BROMMOBIEL",
            "VRACHTWAGEN",
            "CAMPER",
            "CARAVAN",
            "OPLEGGER",
            "AANHANGER",
            "ONDERDEEL",
            "MACHINE",
            "ATTACHMENT",
            "FIETS",
            "BUS",
            "BOOT",
            "TREKKER",
            "GEREEDSCHAP",
            "HULPMIDDEL",
            "SCHIP"
          ]
        },
        "bodywork": {
          "title": "Carrosserie",
          "description": "De carroserie van het voertuig, of kenmerkende vorm",
          "type": "string"
        },
        "doorCount": {
          "title": "Aantal deuren",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "mileage": {
          "title": "Tellerstand, in kilometer of mijl",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "unit",
            "value"
          ],
          "properties": {
            "unit": {
              "title": "De eenheid",
              "description": "Eenheid waarmee de tellerstand is aangegeven, km (K) of mijl (M)",
              "enum": [
                "K",
                "M",
                null
              ]
            },
            "value": {
              "title": "De meterstand",
              "description": "De daadwerkelijke meterstand in de gespecificeerde eenheid, als integer",
              "$ref": "#/definitions/positiveInteger"
            }
          }
        },
        "fuel": {
          "title": "Brandstofsoort",
          "description": "De brandstofsoort, zoals aangegeven in de \"Eigen Website\" XSD → https://eigenwebsite.doorlinkenvoorraad.nl/docs/voertuig.xsd",
          "enum": [
            "B",
            "D",
            "L",
            "3",
            "E",
            "H",
            "C",
            "O",
            null
          ]
        },
        "transmission": {
          "title": "Transmissie",
          "description": "Het type transmissie, zoals aangegeven in de \"Eigen Website\" XSD → https://eigenwebsite.doorlinkenvoorraad.nl/docs/voertuig.xsd",
          "enum": [
            "H",
            "A",
            "S",
            "C",
            null
          ]
        },
        "gearCount": {
          "title": "Aantal versnellingen",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "taxType": {
          "title": "Marge / BTW voertuig",
          "enum": [
            "B",
            "M",
            null
          ]
        },
        "newVehicle": {
          "title": "Nieuw voertuig aanduiding",
          "$ref": "#/definitions/optionalBoolean"
        },
        "paintColour": {
          "title": "Soort verfkleur van het voertuig",
          "description": "Geeft aan of het voertuig licht of donker van kleur is, gebruikt voor het filteren binnen voertuigen.",
          "enum": [
            "licht",
            "midden",
            "donker",
            null
          ]
        },
        "colour": {
          "title": "Specifieke kleur van het voertuig",
          "description": "De naam van de kleur van het voertuig, vrije tekst",
          "$ref": "#/definitions/optionalString"
        },
        "baseColour": {
          "title": "Basiskleur van het voertuig",
          "description": "De basiskleur van het voertuig, waarmee het voertuig in groepen wordt ingedeeld. Gebruik \"colour\" voor de kleurbenaming",
          "enum": [
            "oranje",
            "roze",
            "rood",
            "wit",
            "blauw",
            "groen",
            "geel",
            "grijs",
            "bruin",
            "beige",
            "creme",
            "paars",
            "zwart",
            "overig",
            "goud",
            "zilver"
          ]
        },
        "paintType": {
          "title": "Laksoort",
          "enum": [
            "basis",
            "metallic",
            "mica",
            "parelmoer",
            null
          ]
        },
        "constructionDate": {
          "title": "Constructiedatum",
          "description": "ISO-8601 datum van constructie, mag ook maand en dag bevatten",
          "$ref": "#/definitions/optionalDate"
        },
        "productionYear": {
          "title": "Bouwjaar",
          "description": "Het bouwjaar van het voertuig",
          "$ref": "#/definitions/optionalYear"
        },
        "vehicleDates": {
          "description": "Zie \"datum_deel_1\", \"datum_deel_1a\" en \"datum_deel_1b\" in https://eigenwebsite.doorlinkenvoorraad.nl/docs/voertuig.xsd",
          "type": ["object", "null"],
          "additionalProperties": false,
          "properties": {
            "1": {
              "$ref": "#/definitions/optionalDate"
            },
            "1a": {
              "$ref": "#/definitions/optionalDate"
            },
            "1b": {
              "$ref": "#/definitions/optionalDate"
            }
          }
        },
        "pricePrivate": {
          "title": "Particuliere verkoopprijs",
          "$ref": "#/definitions/price"
        },
        "priceDiscount": {
          "title": "Verkoopprijs bij aanbieding",
          "$ref": "#/definitions/price"
        },
        "priceTrade": {
          "title": "Verkoopprijs voor handel",
          "$ref": "#/definitions/price"
        },
        "motTest": {
          "description": "Geeft aan tot wanneer het voertuig een APK keuring heeft en of deze evt wordt vernieuwd bij aankoop",
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": false,
          "properties": {
            "endDate": {
              "description": "Einddatum van de huidige APK keuring",
              "$ref": "#/definitions/date"
            },
            "atDelivery": {
              "description": "Indicatie of dit voertuig wordt gekeurd bij aflevering",
              "type": "boolean"
            }
          }
        },
        "mass": {
          "title": "Massa van het voertuig, in KG",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "pullMass": {
          "title": "Trekkracht van het voertuig, in KG",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "cylinderCount": {
          "title": "Aantal cylinders",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "cylinderContents": {
          "title": "Cylinderinhoud, in cc",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "enginePowerKw": {
          "title": "Vermogen in kW",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "enginePowerHp": {
          "title": "Vermogen in paardenkracht",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "seatCount": {
          "title": "Aantal stoelen / banken",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "bpmPrice": {
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "interiorColour": {
          "$ref": "#/definitions/optionalString"
        },
        "lining": {
          "description": "Bekleding van het interieur",
          "enum": [
            "Alcantara",
            "Half leder / alcantara",
            "Half leder / stof",
            "Leder",
            "Skai",
            "Stof",
            "Velours",
            null
          ]
        },
        "keyCount": {
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "transmitterCount": {
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "codeTransmitterKey": {
          "enum": [
            "onbekend",
            "pas",
            "sleutel",
            "afwezig",
            "niet van toepassing",
            null
          ]
        },
        "napLabel": {
          "description": "Heeft dit voertuig een NAP label?",
          "$ref": "#/definitions/optionalBoolean"
        },
        "maintenanceLogs": {
          "description": "Zijn er onderhoudsboekjes aanwezig?",
          "enum": [
            "ja",
            "dealer",
            "nee",
            "onbekend",
            null
          ]
        },
        "location": {
          "description": "Huidige locatie van het voertuig",
          "$ref": "#/definitions/optionalString"
        },
        "exportPrice": {
          "title": "Exportrijs",
          "$ref": "#/definitions/price"
        },
        "takeOutPrice": {
          "title": "Meeneemprijs",
          "$ref": "#/definitions/price"
        },
        "dealerPrice": {
          "title": "Inkoopprijs",
          "$ref": "#/definitions/price"
        },
        "bidStart": {
          "title": "Bieden vanaf",
          "$ref": "#/definitions/optionalIntegerWithUnit"
        },
        "reservationPrice": {
          "title": "Reserveringsprijs",
          "$ref": "#/definitions/price"
        },
        "refurbishmentCost": {
          "title": "Opknapkosten",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "roadworthyCost": {
          "title": "Kosten rijklaar",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "averageConsumption": {
          "title": "Gemiddeld gebruik",
          "$ref": "#/definitions/optionalNumber"
        },
        "damagedVehicle": {
          "$ref": "#/definitions/optionalBoolean"
        },
        "consignment": {
          "title": "Consignatie",
          "$ref": "#/definitions/optionalBoolean"
        },
        "demo": {
          "title": "Demo voertuig",
          "$ref": "#/definitions/optionalBoolean"
        },
        "wheelBase": {
          "title": "Wielbasis",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "loadMaximum": {
          "title": "Maximale belading",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "gvw": {
          "title": "Gross Vehicle Weight",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "axleCount": {
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "length": {
          "description": "Lengte van het voertuig, in cm",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "width": {
          "description": "Breedte van het voertuig, in cm",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "height": {
          "description": "Hoogte van het voertuig, in cm",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "vin": {
          "description": "VIN nummer van het voertuig, in vrije vorm",
          "$ref": "#/definitions/optionalString"
        },
        "emissionClass": {
          "description": "Euro emissieklasse van het voertuig",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "fullyAutomatic": {
          "title": "Volautmaat",
          "$ref": "#/definitions/optionalBoolean"
        },
        "energyLabel": {
          "title": "Energielabel",
          "enum": [
            "A",
            "B",
            "C",
            "D",
            "E",
            "F",
            "G",
            null
          ]
        },
        "condition": {
          "$ref": "#/definitions/vehicleCondition"
        },
        "motorBrand": {
          "title": "Motormerk",
          "$ref": "#/definitions/optionalString"
        },
        "motorType": {
          "title": "Motor type",
          "$ref": "#/definitions/optionalString"
        },
        "drive": {
          "title": "Type aandrijving",
          "enum": [
            "motorisch",
            "pneumatisch",
            "hydraulisch",
            "nvt",
            null
          ]
        },
        "newPriceRecalculated": {
          "title": "Nieuwprijs (herberekend)",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "wheelCount": {
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "modelDate": {
          "title": "Modeldatum",
          "type": [
            "null",
            "object"
          ],
          "additionalProperties": false,
          "required": [
            "start",
            "end"
          ],
          "properties": {
            "start": {
              "description": "Start van modelverkoop",
              "$ref": "#/definitions/optionalDate"
            },
            "end": {
              "description": "Eind van modelverkoop",
              "$ref": "#/definitions/optionalDate"
            }
          }
        },
        "modelCode": {
          "title": "Modelcode",
          "$ref": "#/definitions/optionalString"
        },
        "bidAllowed": {
          "title": "Bieden toegestaan",
          "$ref": "#/definitions/optionalBoolean"
        },
        "oldtimer": {
          "title": "Oldtimer",
          "$ref": "#/definitions/optionalBoolean"
        },
        "e10Approved": {
          "description": "Geeft aan of dit voertuig op E10 brandstoffen kan draaien",
          "$ref": "#/definitions/optionalBoolean"
        },
        "newPrice": {
          "title": "Nieuwprijs",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "fiscalValue": {
          "title": "Fiscale waarde",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "additionPercentage": {
          "title": "Bijtelling",
          "$ref": "#/definitions/optionalNumber"
        },
        "saleDate": {
          "title": "Verkoopdatum",
          "$ref": "#/definitions/optionalDate"
        },
        "customWarranty": {
          "title": "Eigen garantielabel",
          "$ref": "#/definitions/optionalString"
        },
        "elongated": {
          "title": "Verlengd",
          "enum": [
            "L1",
            "L2",
            "L3",
            "L4",
            "L5",
            null
          ]
        },
        "raised": {
          "title": "Verhoogd voertuig",
          "enum": [
            "H1",
            "H2",
            "H3",
            null
          ]
        },
        "axlesPowered": {
          "title": "Aantal aangedreven assen",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "receivedDate": {
          "$ref": "#/definitions/optionalDate"
        },
        "rental": {
          "title": "Voertuig is een (ex-) verhuur",
          "$ref": "#/definitions/optionalBoolean"
        },
        "classic": {
          "title": "Voertuig is een klassieker",
          "$ref": "#/definitions/optionalBoolean"
        },
        "maintenanceHistory": {
          "$ref": "#/definitions/maintenanceHistory"
        },
        "deliveryPackages": {
          "$ref": "#/definitions/deliveryPackages"
        },
        "country": {
          "title": "Land van herkomst",
          "type": [
            "string",
            "null"
          ],
          "regex": "^[a-zA-Z]{2}$"
        },
        "topSpeed": {
          "title": "Maximale snelheid (km/h)",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "tankContents": {
          "title": "Inhoud brandstoftank (L)",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "range": {
          "title": "Actieradius (km)",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "maxPullWeightUnrestrained": {
          "title": "Maximaal ongeremd trekgewicht (kg)",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "acceleration": {
          "title": "Accelleratie",
          "$ref": "#/definitions/optionalNumber"
        },
        "maxRoofLoad": {
          "title": "Maximale dakbelasting (kg)",
          "$ref": "#/definitions/optionalNumber"
        },
        "cargoContentsBanksFolded": {
          "title": "Maximale kofferbakinhoud",
          "description": "Inhoud van de kofferbak met alle banken ingeklapt",
          "$ref": "#/definitions/optionalNumber"
        },
        "consumption": {
          "title": "Gemiddeld verbruik",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "city",
            "freeway"
          ],
          "properties": {
            "city": {
              "title": "Verbruik in de stad",
              "$ref": "#/definitions/optionalNumber"
            },
            "freeway": {
              "title": "Verbruik op de snelweg",
              "$ref": "#/definitions/optionalNumber"
            }
          }
        },
        "powerUsage": {
          "title": "Stroomverbruik",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "average",
            "city",
            "freeway"
          ],
          "properties": {
            "average": {
              "title": "Gemidddeld stroomverbruik",
              "$ref": "#/definitions/optionalNumber"
            },
            "city": {
              "title": "Stroomverbruik in de stad",
              "$ref": "#/definitions/optionalNumber"
            },
            "freeway": {
              "title": "Stroomverbruik op de snelweg",
              "$ref": "#/definitions/optionalNumber"
            }
          }
        },
        "co2Emissions": {
          "title": "CO₂ uitstoot, in g/km",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "particulateEmissions": {
          "title": "Fijnstof uitstoot, in g/km",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "factoryWarranty": {
          "title": "Fabrieksgarantie",
          "$ref": "#/definitions/optionalDate"
        },
        "brandWarranty": {
          "title": "Merkgarantie",
          "$ref": "#/definitions/optionalString"
        },
        "dealerWarranty": {
          "title": "Dealer garantie",
          "$ref": "#/definitions/optionalString"
        },
        "bestCarSelection": {
          "description": "Gebruik afgeraden, gebruik \"labels\" veld",
          "$ref": "#/definitions/optionalBoolean"
        },
        "vetosWarranty": {
          "description": "Gebruik afgeraden, gebruik \"labels\" veld",
          "$ref": "#/definitions/optionalBoolean"
        },
        "dealerokWarranty": {
          "description": "Gebruik afgeraden, gebruik \"labels\" veld",
          "$ref": "#/definitions/optionalBoolean"
        },
        "mbsgWarranty": {
          "description": "Gebruik afgeraden, gebruik \"labels\" veld",
          "$ref": "#/definitions/optionalBoolean"
        },
        "pcaTopOccasion": {
          "description": "Gebruik afgeraden, gebruik \"labels\" veld",
          "$ref": "#/definitions/optionalBoolean"
        },
        "autotrustWarranty": {
          "description": "Gebruik afgeraden, gebruik \"labels\" veld",
          "$ref": "#/definitions/optionalBoolean"
        },
        "vakgarantPremiumOccasion": {
          "description": "Gebruik afgeraden, gebruik \"labels\" veld",
          "$ref": "#/definitions/optionalBoolean"
        },
        "vweOccasionGarantPlan": {
          "description": "Gebruik afgeraden, gebruik \"labels\" veld",
          "$ref": "#/definitions/optionalBoolean"
        },
        "carWarranty": {
          "$ref": "#/definitions/optionalBoolean"
        },
        "honderdProcentOnderhouden": {
          "description": "Gebruik afgeraden, gebruik \"labels\" veld",
          "$ref": "#/definitions/optionalBoolean"
        },
        "warrantyBovag": {
          "description": "Aantal maanden Bovag garantie",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "warrantyMonths": {
          "description": "Aantal maanden garantie",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "warrantyMileage": {
          "description": "Maximale kilometerstand voor garantie",
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "warrantyComments": {
          "title": "Opmerkingen bij garantie",
          "$ref": "#/definitions/optionalString"
        },
        "euroNcapRating": {
          "title": "Euro NCAP beoordeling",
          "$ref": "#/definitions/optionalString"
        },
        "directLink": {
          "description": "Directe URL naar het voertuig, waar geadverteerd",
          "$ref": "#/definitions/optionalUrl"
        },
        "contacts": {
          "$ref": "#/definitions/contacts"
        },
        "comments": {
          "description": "Opmerkingen bij voertuig",
          "$ref": "#/definitions/optionalString"
        },
        "tradeComments": {
          "description": "Handelsopmerkingen bij voertuig",
          "$ref": "#/definitions/optionalString"
        },
        "title": {
          "description": "Volledige titel van het voertuig",
          "$ref": "#/definitions/optionalString"
        },
        "highlights": {
          "description": "Highlights van het voertuig",
          "$ref": "#/definitions/optionalString"
        },
        "searchTerms": {
          "description": "Zoektermen van het voertuig, gescheiden door komma's",
          "$ref": "#/definitions/optionalString"
        },
        "defaultComments": {
          "description": "Standaardopmerkingen bij het voertuig, vanuit de dealer",
          "$ref": "#/definitions/optionalString"
        },
        "roadTax": {
          "title": "Wegenbelasting",
          "description": "Verwachte wegenbelasting, als bereik",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "min",
            "max"
          ],
          "properties": {
            "min": {
              "description": "Minimale wegenbelasting",
              "$ref": "#/definitions/optionalPositiveNumber"
            },
            "max": {
              "description": "Maximale wegenbelasting",
              "$ref": "#/definitions/optionalPositiveNumber"
            }
          }
        },
        "sold": {
          "description": "Indicatie of het voertuig is verkocht",
          "$ref": "#/definitions/optionalBoolean"
        },
        "expected": {
          "description": "Indicatie of het voertuig verwacht is bij de dealer",
          "$ref": "#/definitions/optionalBoolean"
        },
        "reserved": {
          "description": "Indicatie of het voertuig gereserveerd is voor verkoop",
          "$ref": "#/definitions/optionalBoolean"
        },
        "optionPackages": {
          "$ref": "#/definitions/optionPackages"
        },
        "accessories": {
          "$ref": "#/definitions/accessoryList"
        },
        "accessoryGroups": {
          "$ref": "#/definitions/accessoryGroups"
        },
        "searchAccessories": {
          "$ref": "#/definitions/accessoryList"
        },
        "labels": {
          "title": "Keurmerk- en garantielabels",
          "description": "Keurmerk en garantielabels voor dit voertuig. Aanwezige labels zijn van toepassing op het voertuig.",
          "type": ["array", "null"],
          "minItems": 1,
          "items": {
            "description": "Kenmerk- of garantielabel van toepassing op dit voertuig",
            "type": "string",
            "minLength": 1
          }
        },
        "images": {
          "description": "Foto's van het voertuig",
          "$ref": "#/definitions/imagelist"
        },
        "videos": {
          "description": "Video's van het voertuig",
          "type": [
            "null",
            "array"
          ],
          "minItems": 1,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "source",
              "code"
            ],
            "properties": {
              "id": {
                "description": "ID van de video, gebruikt voor sortering",
                "$ref": "#/definitions/positiveInteger"
              },
              "source": {
                "description": "Provider van de video",
                "$ref": "#/definitions/optionalString"
              },
              "code": {
                "description": "Code van de video",
                "$ref": "#/definitions/optionalString"
              }
            }
          }
        },
        "documents": {
          "description": "Document bij dit voertuig",
          "type": [
            "null",
            "array"
          ],
          "minItems": 1,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "url",
              "name",
              "date",
              "category",
              "description"
            ],
            "properties": {
              "url": {
                "description": "URL van de videolocatie",
                "$ref": "#/definitions/url"
              },
              "name": {
                "description": "Naam van het document",
                "$ref": "#/definitions/optionalString"
              },
              "date": {
                "description": "Datum van het document",
                "$ref": "#/definitions/optionalDate"
              },
              "category": {
                "description": "Categorie van het document",
                "$ref": "#/definitions/optionalString"
              },
              "description": {
                "description": "Omschrijving van het document",
                "$ref": "#/definitions/optionalString"
              }
            }
          }
        }
      }
    }
  },
  "definitions": {
    "optionalString": {
      "description": "A string, or null",
      "type": [
        "string",
        "null"
      ],
      "minLength": 1
    },
    "optionalNumber": {
      "description": "A float / number value or null",
      "type": [
        "null",
        "number"
      ]
    },
    "positiveInteger": {
      "description": "A positive integer",
      "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
    },
    "optionalPositiveInteger": {
      "description": "A positive integer, that can also be a null value",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
        }
      ]
    },
    "optionalPositiveNumber": {
      "description": "A positive number (with floating point), that can also be a null value",
      "type": [
        "null",
        "number"
      ],
      "minimum": 0
    },
    "url": {
      "description": "A URL",
      "type": "string",
      "format": "uri"
    },
    "optionalUrl": {
      "description": "A URL or a null value",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/definitions/url"
        }
      ]
    },
    "optionalEmail": {
      "description": "An e-mail address or a null value",
      "type": [
        "null",
        "string"
      ],
      "format": "email"
    },
    "date": {
      "description": "A year with optionally a month and day",
      "type": "string",
      "regex": "^[0-9]{4}(-[0-9]{2}){0,2}$"
    },
    "optionalDate": {
      "description": "A year with optionally a month and day, or null",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/definitions/date"
        }
      ]
    },
    "optionalYear": {
      "type": [
        "null",
        "number"
      ],
      "minimum": 1900
    },
    "price": {
      "type": [
        "null",
        "object"
      ],
      "properties": {
        "bpm": {
          "$ref": "#/definitions/priceInclusiveType"
        },
        "btw": {
          "$ref": "#/definitions/priceInclusiveType"
        },
        "value": {
          "$ref": "#/definitions/positiveInteger"
        }
      },
      "required": [
        "value"
      ],
      "additionalProperties": false
    },
    "priceInclusiveType": {
      "type": [
        "null",
        "string"
      ],
      "enum": [
        "in",
        "ex",
        null
      ]
    },
    "optionalIntegerWithUnit": {
      "type": [
        "null",
        "object"
      ],
      "additionalProperties": false,
      "required": [
        "unit",
        "value"
      ],
      "properties": {
        "unit": {
          "$ref": "#/definitions/optionalString"
        },
        "value": {
          "type": "integer"
        }
      }
    },
    "optionalBoolean": {
      "description": "True, false or null",
      "type": [
        "boolean",
        "null"
      ]
    },
    "accessoryResource": {
      "description": "A resource for an accessory, usually images and videos",
      "type": [
        "null",
        "array"
      ],
      "minItems": 1,
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "accessory": {
      "description": "An accessory with a title and priority",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "title"
      ],
      "properties": {
        "priority": {
          "type": "integer",
          "minimum": 1,
          "maximum": 3,
          "default": 2
        },
        "title": {
          "type": "string"
        },
        "images": {
          "$ref": "#/definitions/accessoryResource"
        },
        "videos": {
          "$ref": "#/definitions/accessoryResource"
        }
      }
    },
    "accessoryList": {
      "description": "An array of accessories",
      "type": ["array", "null"],
      "items": {
        "$ref": "#/definitions/accessory"
      },
      "minItems": 1
    },
    "accessoryGroups": {
      "description": "A group of accessories, marked by a title and accessories",
      "type": ["array", "null"],
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "title",
          "accessories"
        ],
        "properties": {
          "title": {
            "type": "string"
          },
          "accessories": {
            "$ref": "#/definitions/accessoryList"
          }
        }
      }
    },
    "optionPackages": {
      "description": "A set of option packages, marked by a title and accessories",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "accessories"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "accessories": {
            "$ref": "#/definitions/accessoryList"
          }
        }
      },
      "minItems": 1
    },
    "vehicleConditionItem": {
      "description": "Staat van één specifiek onderdeel",
      "enum": [
        "zeer goed",
        "goed",
        "gemiddeld",
        "matig",
        "slecht",
        "zeer slecht",
        null
      ]
    },
    "vehicleCondition": {
      "description": "Voertuig conditie",
      "type": [
        "null",
        "object"
      ],
      "additionalProperties": false,
      "required": [
        "general",
        "technical",
        "optical"
      ],
      "properties": {
        "general": {
          "$ref": "#/definitions/vehicleConditionItem"
        },
        "technical": {
          "$ref": "#/definitions/vehicleConditionItem"
        },
        "optical": {
          "$ref": "#/definitions/vehicleConditionItem"
        }
      }
    },
    "maintenanceHistoryKinds": {
      "type": [
        "array",
        "null"
      ],
      "minItems": 1,
      "items": {
        "enum": [
          "grote beurt",
          "kleine beurt",
          "distributieriem",
          "olie verversen",
          "airco onderhoud",
          "apk",
          "reparatie",
          "terugroepactie",
          "overig"
        ],
        "default": "overig"
      }
    },
    "maintenanceHistoryExecutor": {
      "default": "overig",
      "enum": [
        "dealer eigen merk",
        "dealer vreemd merk",
        "merkspecialist",
        "onafhankelijke garage",
        "particulier",
        "overig",
        null
      ]
    },
    "maintenanceHistoryItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "date",
        "mileage",
        "type",
        "description",
        "executor",
        "costComponents",
        "costLabour",
        "costTotal"
      ],
      "properties": {
        "date": {
          "$ref": "#/definitions/optionalDate"
        },
        "mileage": {
          "$ref": "#/definitions/optionalPositiveInteger"
        },
        "type": {
          "$ref": "#/definitions/maintenanceHistoryKinds"
        },
        "description": {
          "$ref": "#/definitions/optionalString"
        },
        "executor": {
          "$ref": "#/definitions/maintenanceHistoryExecutor"
        },
        "costComponents": {
          "$ref": "#/definitions/optionalNumber"
        },
        "costLabour": {
          "$ref": "#/definitions/optionalNumber"
        },
        "costTotal": {
          "$ref": "#/definitions/optionalNumber"
        }
      }
    },
    "maintenanceHistory": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/definitions/maintenanceHistoryItem"
      },
      "minItems": 1
    },
    "deliveryPackages": {
      "descriptions": "An array of delivery packages",
      "type": [
        "null",
        "array"
      ],
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "description",
          "price",
          "default"
        ],
        "properties": {
          "name": {
            "$ref": "#/definitions/optionalString"
          },
          "description": {
            "$ref": "#/definitions/optionalString"
          },
          "price": {
            "$ref": "#/definitions/optionalNumber"
          },
          "default": {
            "$ref": "#/definitions/optionalBoolean"
          }
        }
      }
    },
    "contacts": {
      "description": "A contacts",
      "type": [
        "null",
        "object"
      ],
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "firstName",
          "lastName",
          "email",
          "phoneNumber",
          "mobilePhone"
        ],
        "properties": {
          "id": {
            "$ref": "#/definitions/optionalPositiveInteger"
          },
          "title": {
            "$ref": "#/definitions/optionalString"
          },
          "firstName": {
            "$ref": "#/definitions/optionalString"
          },
          "insert": {
            "$ref": "#/definitions/optionalString"
          },
          "lastName": {
            "$ref": "#/definitions/optionalString"
          },
          "email": {
            "$ref": "#/definitions/optionalEmail"
          },
          "phoneNumber": {
            "$ref": "#/definitions/optionalString"
          },
          "mobileNumber": {
            "$ref": "#/definitions/optionalString"
          }
        }
      }
    },
    "imagelist": {
      "description": "A list of photos or panoramas",
      "type": [
        "null",
        "array"
      ],
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "url",
          "filename",
          "description"
        ],
        "properties": {
          "id": {
            "$ref": "#/definitions/positiveInteger"
          },
          "url": {
            "$ref": "#/definitions/url"
          },
          "filename": {
            "$ref": "#/definitions/optionalString"
          },
          "description": {
            "$ref": "#/definitions/optionalString"
          }
        }
      }
    }
  }
}
