{
  "$defs": {
    "CompChangeReason": {
      "description": "Compensation event reason.",
      "oneOf": [
        {
          "enum": [
            "hire",
            "promotion",
            "annual_review",
            "market_adjustment",
            "role_change",
            "retention",
            "demotion",
            "other"
          ],
          "type": "string"
        },
        {
          "const": "cola",
          "description": "Cost-of-living adjustment.",
          "type": "string"
        },
        {
          "const": "equity_correction",
          "description": "Pay-equity audit corrective adjustment (EU 2023/970 Art. 10).",
          "type": "string"
        },
        {
          "const": "fte_change",
          "description": "FTE % change (parental, partial leave).",
          "type": "string"
        }
      ]
    },
    "CompComponentKind": {
      "description": "Component being changed.",
      "oneOf": [
        {
          "enum": [
            "base_salary",
            "variable_target_pct",
            "equity_grant",
            "signing_bonus",
            "housing_allowance",
            "education_stipend",
            "fte_pct"
          ],
          "type": "string"
        },
        {
          "const": "one_off_cash",
          "description": "One-off cash (spot bonus).",
          "type": "string"
        }
      ]
    },
    "CompensationEvent": {
      "description": "One compensation event.",
      "properties": {
        "approver": {
          "$ref": "#/$defs/PathRef"
        },
        "component": {
          "$ref": "#/$defs/CompComponentKind"
        },
        "currency": {
          "anyOf": [
            {
              "$ref": "#/$defs/IsoCurrency"
            },
            {
              "type": "null"
            }
          ]
        },
        "decision_ref": {
          "anyOf": [
            {
              "$ref": "#/$defs/PathRef"
            },
            {
              "type": "null"
            }
          ],
          "description": "PathRef into the decision / review record."
        },
        "effective_date": {
          "$ref": "#/$defs/IsoDate"
        },
        "new_value": {
          "format": "double",
          "type": "number"
        },
        "notes": {
          "type": [
            "string",
            "null"
          ]
        },
        "prior_value": {
          "description": "Value prior to the event (None for first-event hire).",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "reason": {
          "$ref": "#/$defs/CompChangeReason"
        }
      },
      "required": [
        "effective_date",
        "reason",
        "component",
        "new_value",
        "approver"
      ],
      "type": "object"
    },
    "IsoCurrency": {
      "description": "ISO 4217 currency code.",
      "pattern": "^[A-Z]{3}$",
      "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/compensation-history.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Per-person compensation history.",
  "properties": {
    "entity": {
      "$ref": "#/$defs/PathRef"
    },
    "events": {
      "items": {
        "$ref": "#/$defs/CompensationEvent"
      },
      "type": "array"
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "person": {
      "$ref": "#/$defs/PathRef"
    },
    "pii_class": {
      "$ref": "#/$defs/PiiClass"
    },
    "retention_until": {
      "$ref": "#/$defs/IsoDate",
      "description": "Retention 10 years past last entry (HGB §257)."
    }
  },
  "required": [
    "id",
    "person",
    "entity",
    "events",
    "retention_until",
    "pii_class"
  ],
  "title": "CompensationHistory",
  "type": "object",
  "x-corpospec-pillar": "people"
}