{
  "$defs": {
    "IsoDate": {
      "description": "ISO 8601 date (YYYY-MM-DD).",
      "format": "date",
      "type": "string"
    },
    "OnboardingCategory": {
      "description": "Onboarding-task category.",
      "oneOf": [
        {
          "enum": [
            "other"
          ],
          "type": "string"
        },
        {
          "const": "compliance",
          "description": "Statutory / compliance (e.g. GDPR awareness, anti-harassment).",
          "type": "string"
        },
        {
          "const": "access_setup",
          "description": "Identity, access, equipment.",
          "type": "string"
        },
        {
          "const": "admin_paperwork",
          "description": "HR documentation, payroll setup, A1 / tax-class election.",
          "type": "string"
        },
        {
          "const": "cultural",
          "description": "Welcome / culture / values introductions.",
          "type": "string"
        },
        {
          "const": "role_specific",
          "description": "Role-specific training.",
          "type": "string"
        },
        {
          "const": "relationships",
          "description": "Manager 1:1 / introductions.",
          "type": "string"
        },
        {
          "const": "milestone",
          "description": "30/60/90-day milestone reviews.",
          "type": "string"
        }
      ]
    },
    "OnboardingTaskTemplate": {
      "description": "Template task (rule).",
      "properties": {
        "category": {
          "$ref": "#/$defs/OnboardingCategory"
        },
        "default_owner": {
          "$ref": "#/$defs/PathRef",
          "description": "PathRef to the role-default owner (e.g. people-team, hiring\nmanager)."
        },
        "description": {
          "description": "Free-form description.",
          "type": [
            "string",
            "null"
          ]
        },
        "due_offset_days": {
          "description": "Day offset from start date (0 = day 1).",
          "format": "int32",
          "type": "integer"
        },
        "key": {
          "type": "string"
        },
        "mandatory": {
          "description": "Whether the task is mandatory.",
          "type": "boolean"
        },
        "title": {
          "type": "string"
        }
      },
      "required": [
        "key",
        "title",
        "category",
        "default_owner",
        "due_offset_days",
        "mandatory"
      ],
      "type": "object"
    },
    "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/onboarding-plan.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Entity-wide onboarding template.",
  "properties": {
    "applies_to_roles": {
      "description": "PathRefs to roles this template applies to (empty ⇒ entity-wide).",
      "items": {
        "$ref": "#/$defs/PathRef"
      },
      "type": "array"
    },
    "effective_from": {
      "$ref": "#/$defs/IsoDate"
    },
    "effective_to": {
      "anyOf": [
        {
          "$ref": "#/$defs/IsoDate"
        },
        {
          "type": "null"
        }
      ]
    },
    "entity": {
      "$ref": "#/$defs/PathRef"
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "name": {
      "type": "string"
    },
    "tasks": {
      "items": {
        "$ref": "#/$defs/OnboardingTaskTemplate"
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "entity",
    "name",
    "tasks",
    "effective_from"
  ],
  "title": "OnboardingPlan",
  "type": "object",
  "x-corpospec-pillar": "people"
}