{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fleetkeep-co-uk/json-schema/fleetkeep-co-uk-vehicle-import-preview-schema.json",
  "title": "VehicleImportPreview",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fleetkeep-co-uk-imports-api-openapi.yml#/components/schemas/VehicleImportPreview",
  "type": "object",
  "required": [
    "sourceName",
    "digest",
    "preview",
    "rows",
    "confirmationRequired",
    "selectionDigest",
    "batching",
    "capacity"
  ],
  "properties": {
    "sourceName": {
      "type": "string"
    },
    "digest": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "confirmationRequired": {
      "type": "boolean",
      "const": true
    },
    "preview": {
      "type": "object"
    },
    "rows": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "selectionDigest": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "batching": {
      "type": "object",
      "required": [
        "batchSize",
        "totalRows",
        "sourceRows",
        "sourceLines"
      ],
      "properties": {
        "batchSize": {
          "type": "integer",
          "const": 5
        },
        "totalRows": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000
        },
        "sourceRows": {
          "type": "array",
          "minItems": 1,
          "maxItems": 1000,
          "uniqueItems": true,
          "items": {
            "type": "integer",
            "minimum": 0,
            "maximum": 999
          }
        },
        "sourceLines": {
          "type": "array",
          "minItems": 1,
          "maxItems": 1000,
          "uniqueItems": true,
          "items": {
            "type": "integer",
            "minimum": 1
          }
        }
      }
    },
    "capacity": {
      "type": "object",
      "required": [
        "canImport",
        "currentVehicleCount",
        "vehicleLimit",
        "newVehicleCount",
        "requiredVehicleCount"
      ],
      "properties": {
        "canImport": {
          "type": "boolean"
        },
        "currentVehicleCount": {
          "type": "integer",
          "minimum": 0
        },
        "vehicleLimit": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        },
        "newVehicleCount": {
          "type": "integer",
          "minimum": 0
        },
        "requiredVehicleCount": {
          "type": "integer",
          "minimum": 0
        },
        "error": {
          "type": "string"
        }
      }
    }
  }
}