{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Q11 bates_audit input schema",
  "description": "Strict input shape. Blank templates are preparation scaffolds, not runnable inputs.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "namespaces",
    "pages",
    "approved_gaps"
  ],
  "properties": {
    "namespaces": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "namespace_id",
          "prefix",
          "suffix",
          "digits",
          "expected_start",
          "expected_end"
        ],
        "properties": {
          "namespace_id": {
            "type": "string",
            "minLength": 1
          },
          "prefix": {
            "type": "string"
          },
          "suffix": {
            "type": "string"
          },
          "digits": {
            "type": "integer",
            "minimum": 1
          },
          "expected_start": {
            "type": "integer",
            "minimum": 0
          },
          "expected_end": {
            "type": "integer",
            "minimum": 0
          }
        }
      }
    },
    "pages": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "page_id",
          "production_id",
          "namespace_id",
          "document_alias",
          "page_locator",
          "bates_label"
        ],
        "properties": {
          "page_id": {
            "type": "string",
            "minLength": 1
          },
          "production_id": {
            "type": "string",
            "minLength": 1
          },
          "namespace_id": {
            "type": "string",
            "minLength": 1
          },
          "document_alias": {
            "type": "string",
            "minLength": 1
          },
          "page_locator": {
            "type": "string",
            "minLength": 1
          },
          "bates_label": {
            "type": "string"
          }
        }
      }
    },
    "approved_gaps": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "namespace_id",
          "number",
          "approval_id"
        ],
        "properties": {
          "namespace_id": {
            "type": "string",
            "minLength": 1
          },
          "number": {
            "type": "integer",
            "minimum": 0
          },
          "approval_id": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    }
  }
}
