{
  "$defs": {
    "BavChannel": {
      "description": "DE BAV channel (§1b BetrAVG).",
      "enum": [
        "direktversicherung",
        "pensionskasse",
        "pensionsfonds",
        "unterstuetzungskasse",
        "direktzusage"
      ],
      "type": "string"
    },
    "BenefitCategory": {
      "description": "Benefit category.",
      "oneOf": [
        {
          "enum": [
            "dental",
            "vision",
            "wellness",
            "life_insurance",
            "disability_insurance",
            "equity",
            "stock_purchase_plan",
            "education_stipend",
            "child_care",
            "home_office",
            "phone",
            "meal",
            "other"
          ],
          "type": "string"
        },
        {
          "const": "pension",
          "description": "Pension / retirement (DE BAV, US 401(k), UK workplace pension).",
          "type": "string"
        },
        {
          "const": "health",
          "description": "Statutory or private health insurance subsidy.",
          "type": "string"
        },
        {
          "const": "asset_building",
          "description": "DE VL — Vermögenswirksame Leistungen (asset-building subsidy).",
          "type": "string"
        },
        {
          "const": "commuter",
          "description": "DE ÖPNV / Job-Ticket / Deutschland-Ticket commuter subsidy.",
          "type": "string"
        },
        {
          "const": "hsa",
          "description": "US HSA — Health Savings Account.",
          "type": "string"
        },
        {
          "const": "fsa",
          "description": "US FSA — Flexible Spending Account.",
          "type": "string"
        },
        {
          "const": "cobra",
          "description": "US COBRA continuation right.",
          "type": "string"
        }
      ]
    },
    "FundingModel": {
      "description": "Plan funding model.",
      "oneOf": [
        {
          "enum": [
            "employer_paid",
            "employee_paid",
            "shared"
          ],
          "type": "string"
        },
        {
          "const": "salary_sacrifice",
          "description": "Salary sacrifice / Entgeltumwandlung (DE BAV §1a BetrAVG).",
          "type": "string"
        }
      ]
    },
    "IsoCountry": {
      "description": "ISO 3166-1 alpha-2 country code.",
      "pattern": "^[A-Z]{2}$",
      "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"
    }
  },
  "$id": "https://corpospec.com/schemas/v0.16.0/benefit-plan.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Benefit-plan record (entity-wide rule).",
  "properties": {
    "bav_channel": {
      "anyOf": [
        {
          "$ref": "#/$defs/BavChannel"
        },
        {
          "type": "null"
        }
      ],
      "description": "DE BAV channel (only meaningful when category == Pension and\njurisdiction == DE)."
    },
    "bdr_reference": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ]
    },
    "carrier": {
      "description": "Plan administrator / insurance carrier.",
      "type": "string"
    },
    "category": {
      "$ref": "#/$defs/BenefitCategory"
    },
    "effective_from": {
      "$ref": "#/$defs/IsoDate"
    },
    "effective_to": {
      "anyOf": [
        {
          "$ref": "#/$defs/IsoDate"
        },
        {
          "type": "null"
        }
      ]
    },
    "employer_cap_per_period": {
      "description": "Optional employer contribution cap per period.",
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    },
    "employer_share_pct": {
      "description": "Employer share pct (only meaningful when funding == Shared).",
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    },
    "entity": {
      "$ref": "#/$defs/PathRef"
    },
    "funding": {
      "$ref": "#/$defs/FundingModel"
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "jurisdiction": {
      "$ref": "#/$defs/IsoCountry"
    },
    "name": {
      "type": "string"
    },
    "period_currency": {
      "$ref": "#/$defs/IsoCurrency"
    },
    "plan_document": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ]
    },
    "statutory_basis": {
      "description": "Statutory basis (e.g. \"BetrAVG § 1a\", \"Pensions Act 2008\",\n\"IRC § 401(k)\", \"EStG § 3 Nr. 15\").",
      "type": "string"
    },
    "waiting_period_months": {
      "format": "int32",
      "type": "integer"
    }
  },
  "required": [
    "id",
    "entity",
    "category",
    "name",
    "carrier",
    "funding",
    "period_currency",
    "waiting_period_months",
    "statutory_basis",
    "jurisdiction",
    "effective_from"
  ],
  "title": "BenefitPlan",
  "type": "object",
  "x-corpospec-pillar": "people"
}