{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fleetkeep-co-uk/json-schema/fleetkeep-co-uk-equipment-record-schema.json",
  "title": "EquipmentRecord",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fleetkeep-co-uk-equipment-api-openapi.yml#/components/schemas/EquipmentRecord",
  "allOf": [
    {
      "$ref": "#/$defs/EquipmentInput"
    },
    {
      "type": "object",
      "required": [
        "id",
        "active",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "active": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  ],
  "$defs": {
    "EquipmentDetail": {
      "type": "object",
      "required": [
        "label",
        "value"
      ],
      "properties": {
        "label": {
          "type": "string",
          "maxLength": 60
        },
        "value": {
          "type": "string",
          "maxLength": 240
        }
      },
      "additionalProperties": false
    },
    "EquipmentInput": {
      "type": "object",
      "required": [
        "name",
        "category",
        "status"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        "presetKey": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "tunnel_account",
            "bridge_crossing",
            "gps_tracker",
            "ghost_immobiliser",
            "fuel_card",
            "breakdown_cover",
            "warranty",
            "ownership_hire",
            "service_due",
            null
          ]
        },
        "category": {
          "type": "string",
          "enum": [
            "tracking",
            "security",
            "fuel",
            "other"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "in_place",
            "needs_attention",
            "not_applicable",
            "removed"
          ]
        },
        "provider": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 120
        },
        "reference": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 160
        },
        "portalUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "maxLength": 500
        },
        "startedOn": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "endedOn": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "reviewDueDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "reminderEnabled": {
          "type": "boolean"
        },
        "notes": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 1200
        },
        "details": {
          "type": [
            "array",
            "null"
          ],
          "maxItems": 8,
          "items": {
            "$ref": "#/$defs/EquipmentDetail"
          }
        }
      },
      "additionalProperties": false
    }
  }
}