{
  "$defs": {
    "ConsentChannel": {
      "description": "Channel of capture.",
      "oneOf": [
        {
          "const": "in_app",
          "description": "In-product consent prompt (Cockpit).",
          "type": "string"
        },
        {
          "const": "cookie_banner",
          "description": "Cookie banner / consent management platform.",
          "type": "string"
        },
        {
          "const": "web_form",
          "description": "Web form / sign-up.",
          "type": "string"
        },
        {
          "const": "paper",
          "description": "Paper / wet signature.",
          "type": "string"
        },
        {
          "const": "verbal",
          "description": "Verbal (recorded with timestamp).",
          "type": "string"
        },
        {
          "const": "double_opt_in_email",
          "description": "E-mail double opt-in.",
          "type": "string"
        },
        {
          "const": "api",
          "description": "API caller's authenticated consent.",
          "type": "string"
        }
      ]
    },
    "ConsentPurpose": {
      "description": "Consent purpose (one record per (subject, purpose)).",
      "oneOf": [
        {
          "enum": [
            "other"
          ],
          "type": "string"
        },
        {
          "const": "marketing",
          "description": "Marketing email / SMS.",
          "type": "string"
        },
        {
          "const": "analytics",
          "description": "Product analytics / event telemetry.",
          "type": "string"
        },
        {
          "const": "functional",
          "description": "Functional cookies / session.",
          "type": "string"
        },
        {
          "const": "personalisation",
          "description": "Personalisation / profiling.",
          "type": "string"
        },
        {
          "const": "advertising",
          "description": "3rd-party ad targeting.",
          "type": "string"
        },
        {
          "const": "recording",
          "description": "Voice / video recording.",
          "type": "string"
        },
        {
          "const": "biometric",
          "description": "Biometric processing (Art. 9 special category).",
          "type": "string"
        },
        {
          "const": "third_party_sharing",
          "description": "Sharing with named third parties.",
          "type": "string"
        },
        {
          "const": "research",
          "description": "Research / scientific use.",
          "type": "string"
        },
        {
          "const": "newsletter",
          "description": "Newsletter subscription.",
          "type": "string"
        }
      ]
    },
    "ConsentState": {
      "description": "Consent state.",
      "oneOf": [
        {
          "const": "granted",
          "description": "Subject affirmatively consented.",
          "type": "string"
        },
        {
          "const": "declined",
          "description": "Subject did not consent / opted out.",
          "type": "string"
        },
        {
          "const": "withdrawn",
          "description": "Subject withdrew a prior consent.",
          "type": "string"
        },
        {
          "const": "expired",
          "description": "Consent expired (cookie scope, time-based).",
          "type": "string"
        },
        {
          "const": "pending_confirmation",
          "description": "Pending double opt-in confirmation.",
          "type": "string"
        }
      ]
    },
    "IsoDate": {
      "description": "ISO 8601 date (YYYY-MM-DD).",
      "format": "date",
      "type": "string"
    },
    "PathRef": {
      "description": "Path-based cross-reference relative to .corpospec/ root.\nPattern: `^[a-z0-9_-]+(/[a-z0-9_.-]+)+$`",
      "pattern": "^[a-z0-9_-]+(/[a-z0-9_.-]+)+$",
      "type": "string"
    },
    "PiiClass": {
      "description": "Personal-data classification on every record carrying personal data, per\nBDR 0070 / BDR 0069 / BDR 0078. Used by `corpospec-report` to gate\nrendering and by the privacy pillar's RoPA records to determine\nsafeguards.",
      "oneOf": [
        {
          "const": "none",
          "description": "No personal data.",
          "type": "string"
        },
        {
          "const": "public_personal",
          "description": "Public personal data (already disclosed by the subject, e.g. CEO name).",
          "type": "string"
        },
        {
          "const": "internal",
          "description": "Internal-only personal data (employee directory).",
          "type": "string"
        },
        {
          "const": "personal",
          "description": "Personal data per GDPR Art. 4(1).",
          "type": "string"
        },
        {
          "const": "special_category",
          "description": "Special-category data per GDPR Art. 9 (health, biometric, genetic,\nreligion, ethnicity, sex life, political opinion, trade union).",
          "type": "string"
        },
        {
          "const": "criminal_data",
          "description": "Criminal data per GDPR Art. 10.",
          "type": "string"
        },
        {
          "const": "sensitive",
          "description": "CCPA / CPRA \"sensitive personal information\".",
          "type": "string"
        }
      ]
    }
  },
  "$id": "https://corpospec.com/schemas/v0.16.0/consent-record.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Standalone consent record.",
  "properties": {
    "bundled_with_contract": {
      "description": "Whether consent was bundled with a non-consent purpose\n(Art. 7(4) flag — informational, not necessarily blocking).",
      "type": "boolean"
    },
    "channel": {
      "$ref": "#/$defs/ConsentChannel"
    },
    "controller": {
      "$ref": "#/$defs/PathRef",
      "description": "PathRef to the controller entity."
    },
    "evidence_ref": {
      "$ref": "#/$defs/PathRef",
      "description": "PathRef to consent evidence artefact (signed PDF, JSON of\nbanner click, recording)."
    },
    "expires_at": {
      "anyOf": [
        {
          "$ref": "#/$defs/IsoDate"
        },
        {
          "type": "null"
        }
      ],
      "description": "When consent expires automatically (typical cookie 13 months)."
    },
    "granted_at": {
      "anyOf": [
        {
          "$ref": "#/$defs/IsoDate"
        },
        {
          "type": "null"
        }
      ],
      "description": "When consent was given (None for never-granted)."
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "pii_class": {
      "$ref": "#/$defs/PiiClass"
    },
    "privacy_notice_version": {
      "description": "Version of the privacy notice presented to the subject.",
      "type": "string"
    },
    "purpose": {
      "$ref": "#/$defs/ConsentPurpose"
    },
    "purpose_text": {
      "description": "Free-form purpose narrative shown to the subject.",
      "type": "string"
    },
    "retention_until": {
      "$ref": "#/$defs/IsoDate",
      "description": "Retention until 3 years after withdrawal (BGB §195 generic\nclaims window)."
    },
    "silent_or_pre_ticked": {
      "description": "Whether consent was pre-ticked / silent (Recital 32 — invalid).",
      "type": "boolean"
    },
    "state": {
      "$ref": "#/$defs/ConsentState"
    },
    "subject_pseudonym": {
      "description": "Pseudonymised subject identifier (hash of email / user-id).",
      "type": "string"
    },
    "subject_ref": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "Optional PathRef into the subject (if internal). Omitted for\nanonymous web visitors."
    },
    "withdrawn_at": {
      "anyOf": [
        {
          "$ref": "#/$defs/IsoDate"
        },
        {
          "type": "null"
        }
      ],
      "description": "When consent was withdrawn (None if still in force / expired)."
    }
  },
  "required": [
    "id",
    "controller",
    "subject_pseudonym",
    "purpose",
    "purpose_text",
    "channel",
    "state",
    "evidence_ref",
    "privacy_notice_version",
    "bundled_with_contract",
    "silent_or_pre_ticked",
    "retention_until",
    "pii_class"
  ],
  "title": "StandaloneConsentRecord",
  "type": "object",
  "x-corpospec-pillar": "privacy"
}