{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fleetkeep-co-uk/json-schema/fleetkeep-co-uk-vehicle-schema.json",
  "title": "Vehicle",
  "description": "A single vehicle on the authorised user's account. Official vehicle and compliance fields are populated from DVLA and DVSA records. Insurance, service, operational status and assigned driver fields are user-supplied. serviceDueDate is computed from lastServiceDate using serviceIntervalDays when set, otherwise serviceIntervalMonths.",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fleetkeep-co-uk-openapi.json#/components/schemas/Vehicle",
  "type": "object",
  "required": [
    "id",
    "registration",
    "label",
    "make",
    "model",
    "yearOfManufacture",
    "fuelType",
    "motDueDate",
    "taxDueDate",
    "insuranceDueDate",
    "lastServiceDate",
    "lastServiceMileage",
    "serviceIntervalMonths",
    "serviceIntervalDays",
    "serviceDueDate",
    "operationalStatus",
    "assignedDriverName",
    "assignedDriverContact",
    "statusNotes"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "registration": {
      "type": "string"
    },
    "label": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 80
    },
    "make": {
      "type": [
        "string",
        "null"
      ]
    },
    "model": {
      "type": [
        "string",
        "null"
      ]
    },
    "yearOfManufacture": {
      "type": [
        "integer",
        "null"
      ]
    },
    "fuelType": {
      "type": [
        "string",
        "null"
      ]
    },
    "motDueDate": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "taxDueDate": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "insuranceDueDate": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "lastServiceDate": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "lastServiceMileage": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 1500000
    },
    "serviceIntervalMonths": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 120
    },
    "serviceIntervalDays": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 3650
    },
    "serviceDueDate": {
      "type": [
        "string",
        "null"
      ],
      "format": "date",
      "description": "Computed from lastServiceDate using serviceIntervalDays when set, otherwise serviceIntervalMonths. Null when the date or interval is missing."
    },
    "operationalStatus": {
      "type": "string",
      "enum": [
        "active",
        "standby",
        "in_maintenance",
        "off_road",
        "sold_or_removed"
      ],
      "default": "active"
    },
    "assignedDriverName": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 120
    },
    "assignedDriverContact": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 160
    },
    "statusNotes": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 1000
    }
  }
}