{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://companiadigital.local/notion-google-forms/response-contract.schema.json",
  "title": "NotionGoogleFormsResponseContract",
  "type": "object",
  "required": [
    "contract_version",
    "client",
    "provision_minimum",
    "active_modules",
    "module_payloads",
    "meta"
  ],
  "properties": {
    "contract_version": {
      "type": "string",
      "const": "1.0.0"
    },
    "client": {
      "type": "object",
      "required": [
        "notion_page_id",
        "name",
        "project_type"
      ],
      "properties": {
        "notion_page_id": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "project_type": {
          "type": "string"
        }
      }
    },
    "provision_minimum": {
      "type": "object",
      "required": [
        "title",
        "email",
        "product_slug"
      ],
      "properties": {
        "title": {
          "type": "string",
          "minLength": 1
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "product_slug": {
          "type": "string",
          "minLength": 1
        },
        "url": {
          "type": "string"
        }
      }
    },
    "active_modules": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "assets",
          "faqs",
          "blog",
          "gallery",
          "menu",
          "news",
          "products",
          "projects",
          "team",
          "services",
          "references"
        ]
      }
    },
    "module_payloads": {
      "type": "object",
      "additionalProperties": {
        "type": "object"
      },
      "properties": {
        "assets": {
          "type": "object",
          "properties": {
            "logos_links_raw": { "type": "string" },
            "brand_guide_raw": { "type": "string" }
          }
        },
        "faqs": {
          "type": "object",
          "properties": {
            "faqs_raw": { "type": "string" }
          }
        },
        "blog": {
          "type": "object",
          "properties": {
            "categories_raw": { "type": "string" },
            "topics_raw": { "type": "string" }
          }
        },
        "gallery": {
          "type": "object",
          "properties": {
            "links_raw": { "type": "string" }
          }
        },
        "menu": {
          "type": "object",
          "properties": {
            "sections_raw": { "type": "string" },
            "items_raw": { "type": "string" }
          }
        },
        "news": {
          "type": "object",
          "properties": {
            "categories_raw": { "type": "string" },
            "items_raw": { "type": "string" }
          }
        },
        "products": {
          "type": "object",
          "properties": {
            "products_raw": { "type": "string" }
          }
        },
        "projects": {
          "type": "object",
          "properties": {
            "projects_raw": { "type": "string" }
          }
        },
        "team": {
          "type": "object",
          "properties": {
            "team_raw": { "type": "string" }
          }
        },
        "services": {
          "type": "object",
          "properties": {
            "services_raw": { "type": "string" }
          }
        },
        "references": {
          "type": "object",
          "properties": {
            "references_raw": { "type": "string" }
          }
        }
      }
    },
    "meta": {
      "type": "object",
      "required": [
        "form_id",
        "form_url",
        "submitted_at_iso",
        "blueprint_id"
      ],
      "properties": {
        "form_id": { "type": "string" },
        "form_url": { "type": "string" },
        "submitted_at_iso": { "type": "string" },
        "blueprint_id": { "type": "string" },
        "question_count": { "type": "integer", "minimum": 1 }
      }
    }
  }
}
