{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "SGCA Year 9-10 Theory Book",
  "type": "object",
  "properties": {
    "theory_book": {
      "type": "object",
      "properties": {
        "year_range": { "type": "string", "enum": ["9-10"] },
        "age_band": { "type": "string", "enum": ["13-15"] },
        "visualtier": { "type": "string", "enum": ["Stage4TeenStylised_Realism"] },
        "lighting_stage": { "type": "integer", "enum": [3] },
        "drifttolerancepercent": { "type": "integer", "minimum": 0, "maximum": 5 },
        "poseregistryversion": { "type": "string", "enum": ["3.0"] },
        "hairevolutionversion": { "type": "string", "enum": ["3.x"] },
        "chipgovernanceversion": { "type": "string", "enum": ["3.x"] },
        "page_count": { "type": "integer", "minimum": 1 },
        "trim_size": { "type": "string", "pattern": "^\\d+\\.\\d+x\\d+\\.\\d+$" },
        "units": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "unitid": { "type": "string" },
              "conceptfamily": { "type": "string" },
              "diagram_complexity": { "type": "string", "enum": ["high"] }
            },
            "required": ["unitid", "conceptfamily", "diagram_complexity"]
          }
        },
        "visual_constraints": {
          "type": "object",
          "properties": {
            "maxrealismstage": { "type": "string", "enum": ["stylised_realism"] },
            "lighting_caps": {
              "type": "object",
              "properties": {
                "maxcontrastdelta": { "type": "number", "maximum": 0.10 }
              },
              "required": ["maxcontrastdelta"]
            }
          },
          "required": ["maxrealismstage", "lighting_caps"]
        },
        "rotation_window": { "type": "integer", "enum": [6] },
        "interioranchorrequired": { "type": "boolean" }
      },
      "required": ["year_range", "age_band", "visualtier", "lighting_stage", "drifttolerancepercent", "poseregistryversion", "hairevolutionversion", "chipgovernanceversion", "page_count", "trim_size", "units", "visual_constraints", "rotation_window", "interioranchorrequired"]
    }
  },
  "required": ["theory_book"]
}
