{
  "$defs": {
    "EquityTreatment": {
      "description": "Equity treatment at termination.",
      "oneOf": [
        {
          "enum": [
            "not_applicable"
          ],
          "type": "string"
        },
        {
          "const": "good_leaver",
          "description": "Unvested forfeited, vested retained.",
          "type": "string"
        },
        {
          "const": "bad_leaver",
          "description": "Unvested forfeited, vested forfeited.",
          "type": "string"
        },
        {
          "const": "custom",
          "description": "Special carve-out / accelerated vesting.",
          "type": "string"
        }
      ]
    },
    "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"
        }
      ]
    },
    "SeverancePackage": {
      "description": "Severance / final-pay breakdown.",
      "properties": {
        "basis": {
          "description": "Calculation basis (e.g. \"0.5 × monthly gross × tenure years\n(§1a KSchG)\", \"WARN Act 60-day pay continuation\").",
          "type": "string"
        },
        "bonus_proration": {
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "currency": {
          "$ref": "#/$defs/IsoCurrency"
        },
        "gross_amount": {
          "format": "double",
          "type": "number"
        },
        "outplacement_amount": {
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "vacation_cashout": {
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        }
      },
      "required": [
        "currency",
        "gross_amount",
        "basis"
      ],
      "type": "object"
    },
    "TerminationKind": {
      "description": "Termination type.",
      "oneOf": [
        {
          "enum": [
            "resignation",
            "fixed_term_end",
            "probationary_end",
            "retirement",
            "death"
          ],
          "type": "string"
        },
        {
          "const": "employer_notice",
          "description": "Employer notice (ordentliche Kündigung).",
          "type": "string"
        },
        {
          "const": "summary_dismissal",
          "description": "Employer summary dismissal (außerordentliche/fristlose Kündigung).",
          "type": "string"
        },
        {
          "const": "mutual_agreement",
          "description": "Mutual agreement (Aufhebungsvertrag).",
          "type": "string"
        },
        {
          "const": "redundancy",
          "description": "Redundancy / RIF / Betriebsbedingt.",
          "type": "string"
        }
      ]
    },
    "TerminationReasonClass": {
      "description": "Reason class (HR analytics + ISO 30414 disclosures).",
      "oneOf": [
        {
          "enum": [
            "performance",
            "conduct",
            "personenbedingt",
            "restructuring",
            "end_of_term",
            "voluntary",
            "health_long_term",
            "new_opportunity",
            "other"
          ],
          "type": "string"
        },
        {
          "const": "operational",
          "description": "Betriebsbedingt (operational).",
          "type": "string"
        }
      ]
    }
  },
  "$id": "https://corpospec.com/schemas/v0.16.0/termination.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Termination record.",
  "properties": {
    "contract": {
      "$ref": "#/$defs/PathRef"
    },
    "effective_date": {
      "$ref": "#/$defs/IsoDate",
      "description": "Last working day (Beendigung)."
    },
    "entity": {
      "$ref": "#/$defs/PathRef"
    },
    "equity_treatment": {
      "$ref": "#/$defs/EquityTreatment"
    },
    "garden_leave_days": {
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "kind": {
      "$ref": "#/$defs/TerminationKind"
    },
    "notice_date": {
      "$ref": "#/$defs/IsoDate",
      "description": "Date the notice was issued (DE §623 BGB requires written form)."
    },
    "notice_period": {
      "description": "Notice period ISO 8601 duration (`P3M`).",
      "type": "string"
    },
    "person": {
      "$ref": "#/$defs/PathRef"
    },
    "pii_class": {
      "$ref": "#/$defs/PiiClass"
    },
    "post_termination_obligations": {
      "description": "Free-form summary of NDA / non-compete enforcement decisions.",
      "type": [
        "string",
        "null"
      ]
    },
    "reason_class": {
      "$ref": "#/$defs/TerminationReasonClass"
    },
    "reason_detail": {
      "type": [
        "string",
        "null"
      ]
    },
    "retention_until": {
      "$ref": "#/$defs/IsoDate",
      "description": "Retention 10 years (HGB §257 / AO §147)."
    },
    "severance": {
      "anyOf": [
        {
          "$ref": "#/$defs/SeverancePackage"
        },
        {
          "type": "null"
        }
      ]
    },
    "termination_document": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ]
    },
    "work_reference": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef into the Arbeitszeugnis (DE work reference)."
    },
    "works_council_consulted": {
      "description": "Whether works council was consulted (§102 BetrVG).",
      "type": "boolean"
    },
    "works_council_record": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "id",
    "person",
    "contract",
    "entity",
    "kind",
    "reason_class",
    "notice_date",
    "effective_date",
    "notice_period",
    "equity_treatment",
    "works_council_consulted",
    "retention_until",
    "pii_class"
  ],
  "title": "Termination",
  "type": "object",
  "x-corpospec-pillar": "people"
}