{
  "$defs": {
    "IsoCountry": {
      "description": "ISO 3166-1 alpha-2 country code.",
      "pattern": "^[A-Z]{2}$",
      "type": "string"
    },
    "IsoDate": {
      "description": "ISO 8601 date (YYYY-MM-DD).",
      "format": "date",
      "type": "string"
    },
    "JobCategoryGap": {
      "description": "Per-job-category breakdown for \"work of equal value\" analysis\n(EU 2023/970 Art. 9 §1c).",
      "properties": {
        "category": {
          "description": "Internal category label (Hay-grade, internal level, etc. — must\nbe objective and gender-neutral per Art. 9 §3).",
          "type": "string"
        },
        "crosses_art10_threshold": {
          "description": "Whether this category exceeds the 5% Art. 10 trigger.",
          "type": "boolean"
        },
        "mean_gap_pct": {
          "format": "double",
          "type": "number"
        },
        "median_gap_pct": {
          "format": "double",
          "type": "number"
        },
        "population_size": {
          "format": "int32",
          "type": "integer"
        }
      },
      "required": [
        "category",
        "mean_gap_pct",
        "median_gap_pct",
        "population_size",
        "crosses_art10_threshold"
      ],
      "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"
    },
    "PayAuditStatus": {
      "description": "Audit report lifecycle.",
      "oneOf": [
        {
          "enum": [
            "draft",
            "validated",
            "closed"
          ],
          "type": "string"
        },
        {
          "const": "filed",
          "description": "Filed with the supervisory authority.",
          "type": "string"
        },
        {
          "const": "joint_assessment_in_progress",
          "description": "Joint pay assessment in progress (Art. 10).",
          "type": "string"
        }
      ]
    },
    "PayAxis": {
      "description": "Comparison axis.",
      "enum": [
        "gender",
        "age",
        "ethnicity",
        "disability"
      ],
      "type": "string"
    },
    "PayComponent": {
      "description": "Pay component scope.",
      "oneOf": [
        {
          "enum": [
            "base_salary"
          ],
          "type": "string"
        },
        {
          "const": "variable_cash",
          "description": "All variable cash compensation.",
          "type": "string"
        },
        {
          "const": "equity",
          "description": "Equity grants at fair value.",
          "type": "string"
        },
        {
          "const": "total_compensation",
          "description": "All-in: base + variable + equity FV + benefits.",
          "type": "string"
        }
      ]
    },
    "PayGapMeasurement": {
      "description": "One pay-gap measurement.",
      "properties": {
        "axis": {
          "$ref": "#/$defs/PayAxis"
        },
        "comparator_group": {
          "type": "string"
        },
        "component": {
          "$ref": "#/$defs/PayComponent"
        },
        "mean_gap_pct": {
          "description": "Mean gap pct (positive: reference group earns more).",
          "format": "double",
          "type": "number"
        },
        "median_gap_pct": {
          "format": "double",
          "type": "number"
        },
        "population_size": {
          "format": "int32",
          "type": "integer"
        },
        "reference_group": {
          "type": "string"
        }
      },
      "required": [
        "axis",
        "component",
        "mean_gap_pct",
        "median_gap_pct",
        "reference_group",
        "comparator_group",
        "population_size"
      ],
      "type": "object"
    },
    "QuartileGap": {
      "description": "Quartile breakdown (Q1 lowest pay → Q4 highest).",
      "properties": {
        "female_share_pct": {
          "format": "double",
          "type": "number"
        },
        "male_share_pct": {
          "format": "double",
          "type": "number"
        },
        "mean_gap_pct": {
          "format": "double",
          "type": "number"
        },
        "other_share_pct": {
          "format": "double",
          "type": "number"
        },
        "quartile": {
          "format": "int32",
          "type": "integer"
        }
      },
      "required": [
        "quartile",
        "female_share_pct",
        "male_share_pct",
        "other_share_pct",
        "mean_gap_pct"
      ],
      "type": "object"
    }
  },
  "$id": "https://corpospec.com/schemas/v0.16.0/pay-equity-audit.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Pay-equity audit record.",
  "properties": {
    "corrective_plan": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef into the corrective action plan."
    },
    "entity": {
      "$ref": "#/$defs/PathRef"
    },
    "filed_at": {
      "anyOf": [
        {
          "$ref": "#/$defs/IsoDate"
        },
        {
          "type": "null"
        }
      ]
    },
    "headcount_fte": {
      "format": "int32",
      "type": "integer"
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "job_category_breakdown": {
      "items": {
        "$ref": "#/$defs/JobCategoryGap"
      },
      "type": "array"
    },
    "joint_assessment_ref": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef into the joint pay assessment record."
    },
    "jurisdiction": {
      "$ref": "#/$defs/IsoCountry"
    },
    "measurements": {
      "items": {
        "$ref": "#/$defs/PayGapMeasurement"
      },
      "type": "array"
    },
    "published_report": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef into the published report (Art. 9 §6 publication duty)."
    },
    "quartiles": {
      "items": {
        "$ref": "#/$defs/QuartileGap"
      },
      "type": "array"
    },
    "reporting_period_end": {
      "$ref": "#/$defs/IsoDate"
    },
    "reporting_period_start": {
      "$ref": "#/$defs/IsoDate"
    },
    "retention_until": {
      "$ref": "#/$defs/IsoDate",
      "description": "10-year retention (HGB §257 + audit-trail convention)."
    },
    "status": {
      "$ref": "#/$defs/PayAuditStatus"
    },
    "triggers_art10_joint_assessment": {
      "description": "Whether any unjustified gap ≥5% triggers Art. 10.",
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "entity",
    "reporting_period_start",
    "reporting_period_end",
    "headcount_fte",
    "jurisdiction",
    "measurements",
    "quartiles",
    "job_category_breakdown",
    "triggers_art10_joint_assessment",
    "status",
    "retention_until"
  ],
  "title": "PayEquityAudit",
  "type": "object",
  "x-corpospec-pillar": "people"
}