{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fleetkeep-co-uk/json-schema/fleetkeep-co-uk-walkaround-history-schema.json",
  "title": "WalkaroundHistory",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fleetkeep-co-uk-openapi.json#/components/schemas/WalkaroundHistory",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "completedToday",
    "checks",
    "page"
  ],
  "properties": {
    "completedToday": {
      "type": "boolean"
    },
    "checks": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "checkedAt",
          "driverName",
          "odometerMileage",
          "definitionVersion",
          "results",
          "safeToDrive",
          "defectEventId",
          "defectStatus",
          "media"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "checkedAt": {
            "type": "string",
            "format": "date-time"
          },
          "driverName": {
            "type": [
              "string",
              "null"
            ]
          },
          "odometerMileage": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 1500000
          },
          "definitionVersion": {
            "type": [
              "string",
              "null"
            ]
          },
          "results": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "state"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "ok",
                    "defect",
                    "not_applicable"
                  ]
                }
              }
            }
          },
          "safeToDrive": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "defectEventId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "defectStatus": {
            "type": [
              "string",
              "null"
            ]
          },
          "media": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "fileName",
                "contentType",
                "href"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "fileName": {
                  "type": "string"
                },
                "contentType": {
                  "type": "string"
                },
                "href": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "page": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "limit",
        "offset",
        "hasMore",
        "nextOffset"
      ],
      "properties": {
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "offset": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740990
        },
        "hasMore": {
          "type": "boolean"
        },
        "nextOffset": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "maximum": 9007199254740991
        }
      }
    }
  }
}