{
  "$defs": {
    "ComplaintsMechanism": {
      "description": "Complaints-mechanism / grievance channel.",
      "properties": {
        "allows_anonymous": {
          "description": "Whether anonymous reporting is possible.",
          "type": "boolean"
        },
        "complaints_register_ref": {
          "anyOf": [
            {
              "$ref": "#/$defs/PathRef"
            },
            {
              "type": "null"
            }
          ],
          "description": "Whether complaints are tracked in a register."
        },
        "description": {
          "description": "Description (e.g. \"Multilingual whistleblower portal + email\").",
          "type": "string"
        },
        "languages": {
          "description": "Languages supported.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "policy_ref": {
          "$ref": "#/$defs/PathRef",
          "description": "URL or PathRef to the policy."
        }
      },
      "required": [
        "description",
        "policy_ref",
        "languages",
        "allows_anonymous"
      ],
      "type": "object"
    },
    "DueDiligenceRegime": {
      "description": "DD regime.",
      "oneOf": [
        {
          "const": "de_lksg",
          "description": "DE Lieferkettensorgfaltspflichtengesetz.",
          "type": "string"
        },
        {
          "const": "eu_csddd",
          "description": "EU Corporate Sustainability Due Diligence Directive.",
          "type": "string"
        },
        {
          "const": "un_guiding_principles",
          "description": "UN Guiding Principles on Business and Human Rights.",
          "type": "string"
        },
        {
          "const": "oecd_due_diligence",
          "description": "OECD Due Diligence Guidance for Responsible Business Conduct.",
          "type": "string"
        },
        {
          "const": "us_ca_ctsca",
          "description": "California Transparency in Supply Chains Act.",
          "type": "string"
        },
        {
          "const": "uk_modern_slavery_act",
          "description": "UK Modern Slavery Act 2015.",
          "type": "string"
        },
        {
          "const": "voluntary",
          "description": "Voluntary internal regime.",
          "type": "string"
        }
      ]
    },
    "DueDiligenceStatus": {
      "description": "DD lifecycle.",
      "oneOf": [
        {
          "enum": [
            "draft",
            "approved",
            "filed",
            "under_revision"
          ],
          "type": "string"
        },
        {
          "const": "closed",
          "description": "Closed for the current reporting period.",
          "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"
    },
    "RiskDomain": {
      "description": "Risk domain.",
      "oneOf": [
        {
          "const": "forced_labour",
          "description": "Forced labour / modern slavery.",
          "type": "string"
        },
        {
          "const": "child_labour",
          "description": "Child labour.",
          "type": "string"
        },
        {
          "const": "wages_working_hours",
          "description": "Wages / working hours.",
          "type": "string"
        },
        {
          "const": "health_safety",
          "description": "Health and safety.",
          "type": "string"
        },
        {
          "const": "freedom_association",
          "description": "Freedom of association.",
          "type": "string"
        },
        {
          "const": "discrimination",
          "description": "Discrimination / harassment.",
          "type": "string"
        },
        {
          "const": "land_rights",
          "description": "Indigenous rights / land grabbing.",
          "type": "string"
        },
        {
          "const": "emissions",
          "description": "Environment — emissions.",
          "type": "string"
        },
        {
          "const": "waste",
          "description": "Environment — waste / hazardous materials.",
          "type": "string"
        },
        {
          "const": "biodiversity",
          "description": "Environment — biodiversity.",
          "type": "string"
        },
        {
          "const": "water",
          "description": "Environment — water.",
          "type": "string"
        },
        {
          "const": "conflict_minerals",
          "description": "Conflict minerals (3TG: tantalum, tin, tungsten, gold).",
          "type": "string"
        },
        {
          "const": "anti_bribery",
          "description": "Anti-bribery / corruption.",
          "type": "string"
        },
        {
          "const": "data_privacy",
          "description": "Data privacy.",
          "type": "string"
        }
      ]
    },
    "SupplyChainRisk": {
      "description": "One risk assessment for a (vendor × domain) pair.",
      "properties": {
        "country_risk_index": {
          "description": "Country-of-operation risk source (e.g. BAFA risk index).",
          "type": [
            "string",
            "null"
          ]
        },
        "domain": {
          "$ref": "#/$defs/RiskDomain"
        },
        "inherent_risk": {
          "$ref": "#/$defs/SupplyChainRiskLevel"
        },
        "preventive_measures": {
          "description": "Preventive measures (LkSG §6).",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "remedial_actions": {
          "description": "Remedial actions (LkSG §7) if risk materialised.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "residual_risk": {
          "$ref": "#/$defs/SupplyChainRiskLevel"
        },
        "tier": {
          "description": "Tier (1 = direct supplier; 2+ = upstream).",
          "format": "int32",
          "type": "integer"
        },
        "vendor": {
          "$ref": "#/$defs/PathRef",
          "description": "PathRef to the vendor record."
        }
      },
      "required": [
        "vendor",
        "tier",
        "domain",
        "inherent_risk",
        "residual_risk",
        "preventive_measures"
      ],
      "type": "object"
    },
    "SupplyChainRiskLevel": {
      "description": "Inherent + residual risk scoring (qualitative).",
      "enum": [
        "negligible",
        "low",
        "medium",
        "high",
        "severe"
      ],
      "type": "string"
    }
  },
  "$id": "https://corpospec.com/schemas/v0.16.0/supply-chain-due-diligence.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Supply-chain DD record.",
  "properties": {
    "annual_report_filed": {
      "description": "Whether the annual report has been filed with BAFA (LkSG) /\nequivalent.",
      "type": "boolean"
    },
    "annual_report_ref": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ]
    },
    "complaints_mechanism": {
      "$ref": "#/$defs/ComplaintsMechanism",
      "description": "Complaints / grievance mechanism (LkSG §8 / CSDDD Art. 13)."
    },
    "created_at": {
      "$ref": "#/$defs/IsoDate"
    },
    "entity": {
      "$ref": "#/$defs/PathRef"
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "next_review_due": {
      "$ref": "#/$defs/IsoDate"
    },
    "policy_statement_ref": {
      "$ref": "#/$defs/PathRef",
      "description": "Policy statement (LkSG §6 Abs. 2 / CSDDD Art. 7)."
    },
    "regimes": {
      "items": {
        "$ref": "#/$defs/DueDiligenceRegime"
      },
      "type": "array"
    },
    "reporting_period_end": {
      "$ref": "#/$defs/IsoDate"
    },
    "reporting_period_start": {
      "$ref": "#/$defs/IsoDate"
    },
    "responsible_person": {
      "$ref": "#/$defs/PathRef",
      "description": "PathRef to the appointed responsible person (LkSG §4 Abs. 3 —\n\"Menschenrechtsbeauftragte:r\")."
    },
    "risks": {
      "description": "Risk register (per vendor × domain).",
      "items": {
        "$ref": "#/$defs/SupplyChainRisk"
      },
      "type": "array"
    },
    "status": {
      "$ref": "#/$defs/DueDiligenceStatus"
    }
  },
  "required": [
    "id",
    "entity",
    "regimes",
    "reporting_period_start",
    "reporting_period_end",
    "policy_statement_ref",
    "responsible_person",
    "risks",
    "complaints_mechanism",
    "annual_report_filed",
    "status",
    "created_at",
    "next_review_due"
  ],
  "title": "SupplyChainDueDiligence",
  "type": "object",
  "x-corpospec-pillar": "sustainability"
}