{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://soc2auditors.org/soc2zip/intake-schema.json",
  "title": "soc2.zip draft intake",
  "description": "Buyer-reviewed company and security posture facts accepted by the soc2.zip intake form.",
  "type": "object",
  "properties": {
    "company": { "type": "string", "minLength": 1, "maxLength": 200 },
    "website": {
      "anyOf": [
        {
          "anyOf": [
            { "not": {} },
            { "type": "string", "format": "uri", "maxLength": 500 }
          ]
        },
        { "type": "string", "const": "" }
      ]
    },
    "headcount": {
      "type": "string",
      "enum": ["1-10", "11-50", "51-100", "101-250", "251+"]
    },
    "stack": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "AWS",
          "GCP",
          "Azure",
          "Cloudflare",
          "Vercel",
          "Stripe",
          "Twilio",
          "Postgres-managed",
          "Mongo-managed",
          "GitHub",
          "Other"
        ]
      },
      "maxItems": 11
    },
    "industry": { "type": "string", "minLength": 1, "maxLength": 200 },
    "deadline": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
    "audit_target": { "type": "string", "enum": ["Type 1", "Type 2"] },
    "has_policies": { "type": "string", "enum": ["yes", "no"] },
    "has_evidence_binder": { "type": "string", "enum": ["yes", "no"] },
    "has_caiq_filled": { "type": "string", "enum": ["yes", "no"] },
    "has_control_tests_run": { "type": "string", "enum": ["yes", "no"] },
    "prior_auditor": { "type": "string", "enum": ["yes", "no"] },
    "aws_optin": { "type": "boolean" },
    "incorporated_in": { "type": "string", "minLength": 1, "maxLength": 300 },
    "headquarters": { "type": "string", "minLength": 1, "maxLength": 300 },
    "founded_year": { "type": "integer", "minimum": 1800, "maximum": 2100 },
    "sub_vertical": { "type": "string", "minLength": 1, "maxLength": 300 },
    "regulated_data": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": ["none", "phi", "cardholder", "financial", "pii_heavy"]
      },
      "maxItems": 5,
      "not": {
        "allOf": [{ "contains": { "const": "none" } }, { "minItems": 2 }]
      }
    },
    "deadline_driver": {
      "type": "string",
      "enum": [
        "enterprise_deal",
        "customer_requirement",
        "proactive",
        "renewal"
      ]
    },
    "deal_acv_usd": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 1000000000
    },
    "budget_ceiling_usd": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 1000000000
    },
    "budget_ceiling_note": {
      "type": "string",
      "minLength": 1,
      "maxLength": 300
    },
    "auditor_engaged": { "type": "boolean" },
    "idp": {
      "type": "string",
      "enum": [
        "google_workspace",
        "okta",
        "azure_ad",
        "jumpcloud",
        "other",
        "none"
      ]
    },
    "mfa_enforced": { "type": "string", "enum": ["yes", "no"] },
    "endpoint_management": {
      "type": "string",
      "enum": ["none", "jamf", "kandji", "intune", "workspace_only", "other"]
    },
    "monitoring": {
      "type": "string",
      "enum": ["datadog", "cloudwatch", "grafana", "sentry", "other", "none"]
    },
    "data_warehouse": {
      "type": "string",
      "enum": ["none", "snowflake", "bigquery", "redshift", "other"]
    },
    "log_retention_days": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 3650
    },
    "backup_retention_days": {
      "type": "string",
      "enum": ["7", "14", "30", "90", "unsure"]
    },
    "backups_tested_in_last_12mo": { "type": "string", "enum": ["yes", "no"] },
    "named_security_lead": {
      "type": "string",
      "minLength": 1,
      "maxLength": 300
    },
    "office_present": { "type": "string", "enum": ["yes", "no"] },
    "office_access_control": {
      "type": "string",
      "minLength": 1,
      "maxLength": 300
    },
    "quarterly_access_review_run": { "type": "string", "enum": ["yes", "no"] },
    "background_checks_run": {
      "type": "string",
      "enum": ["all", "employees_only", "none"]
    },
    "annual_security_training_run": { "type": "string", "enum": ["yes", "no"] },
    "additional_subprocessors": {
      "type": "array",
      "items": { "type": "string", "minLength": 1, "maxLength": 300 },
      "maxItems": 100
    },
    "_provenance": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "tier": {
            "type": "string",
            "enum": ["verified", "attested", "inferred", "default"]
          },
          "source": {
            "type": "string",
            "enum": [
              "buyer",
              "agent",
              "crawl",
              "aws_scan",
              "github_scan",
              "persona"
            ]
          },
          "retrieved_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "string", "const": "unknown" }
            ]
          }
        },
        "required": ["tier", "source", "retrieved_at"],
        "additionalProperties": false
      },
      "propertyNames": { "minLength": 1 }
    }
  },
  "additionalProperties": false
}
