{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ryckmanappraisals.com/resources/pct/schemas/catalog-1.0.schema.json",
  "title": "Ryckman Appraisals universal PCT catalog, version 1.0",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "catalog_id",
    "release_id",
    "reviewed_on",
    "title",
    "scope",
    "usage",
    "categories",
    "operations"
  ],
  "properties": {
    "schema_version": {
      "const": "1.0"
    },
    "catalog_id": {
      "const": "ra-universal-pct"
    },
    "release_id": {
      "type": "string",
      "pattern": "^20[0-9]{2}-[0-9]{2}-[0-9]{2}\\.[1-9][0-9]*$"
    },
    "reviewed_on": {
      "type": "string",
      "format": "date"
    },
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "scope": {
      "type": "string",
      "minLength": 1,
      "maxLength": 600
    },
    "usage": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "purpose",
        "limits",
        "verification_definitions"
      ],
      "properties": {
        "purpose": {
          "type": "string",
          "minLength": 1,
          "maxLength": 600
        },
        "limits": {
          "type": "string",
          "minLength": 1,
          "maxLength": 600
        },
        "verification_definitions": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "repair_scope",
            "estimating_inclusions",
            "work_documentation",
            "vehicle_procedure",
            "product_instructions",
            "service_record"
          ],
          "properties": {
            "repair_scope": {
              "type": "string",
              "minLength": 1,
              "maxLength": 600
            },
            "estimating_inclusions": {
              "type": "string",
              "minLength": 1,
              "maxLength": 600
            },
            "work_documentation": {
              "type": "string",
              "minLength": 1,
              "maxLength": 600
            },
            "vehicle_procedure": {
              "type": "string",
              "minLength": 1,
              "maxLength": 600
            },
            "product_instructions": {
              "type": "string",
              "minLength": 1,
              "maxLength": 600
            },
            "service_record": {
              "type": "string",
              "minLength": 1,
              "maxLength": 600
            }
          }
        }
      }
    },
    "categories": {
      "type": "array",
      "minItems": 1,
      "maxItems": 32,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "label"
        ],
        "properties": {
          "code": {
            "enum": [
              "ACC",
              "BDY",
              "DIA",
              "ELE",
              "FLD",
              "FRM",
              "GLS",
              "MAT",
              "RFN",
              "STR",
              "SVC",
              "WHL"
            ]
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          }
        }
      }
    },
    "operations": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1000,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "category",
          "description",
          "operation_kind",
          "guidance",
          "verification"
        ],
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[A-Z]{3}[0-9]{2}$"
          },
          "category": {
            "enum": [
              "ACC",
              "BDY",
              "DIA",
              "ELE",
              "FLD",
              "FRM",
              "GLS",
              "MAT",
              "RFN",
              "STR",
              "SVC",
              "WHL"
            ]
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "operation_kind": {
            "enum": [
              "diagnostic",
              "electrical",
              "external_service",
              "inspection",
              "material",
              "protection",
              "refinish",
              "remove_install",
              "repair",
              "replacement",
              "structural",
              "vehicle_handling"
            ]
          },
          "guidance": {
            "type": "string",
            "minLength": 1,
            "maxLength": 600
          },
          "verification": {
            "type": "array",
            "minItems": 3,
            "maxItems": 6,
            "uniqueItems": true,
            "items": {
              "enum": [
                "repair_scope",
                "estimating_inclusions",
                "work_documentation",
                "vehicle_procedure",
                "product_instructions",
                "service_record"
              ]
            }
          }
        }
      }
    }
  }
}
