{
  "$defs": {
    "AssuranceLevel": {
      "description": "Assurance level.",
      "oneOf": [
        {
          "const": "none",
          "description": "No external assurance.",
          "type": "string"
        },
        {
          "const": "limited",
          "description": "Limited assurance (ISAE 3000 / 3410).",
          "type": "string"
        },
        {
          "const": "reasonable",
          "description": "Reasonable assurance (ISAE 3000 / 3410).",
          "type": "string"
        }
      ]
    },
    "DisclosureFramework": {
      "description": "Disclosure framework.",
      "oneOf": [
        {
          "const": "csrd_esrs",
          "description": "CSRD + ESRS (EU).",
          "type": "string"
        },
        {
          "const": "ifrs_s1",
          "description": "IFRS S1 — General sustainability disclosures.",
          "type": "string"
        },
        {
          "const": "ifrs_s2",
          "description": "IFRS S2 — Climate-related disclosures.",
          "type": "string"
        },
        {
          "const": "sasb",
          "description": "SASB (Sustainability Accounting Standards Board).",
          "type": "string"
        },
        {
          "const": "gri",
          "description": "GRI (Global Reporting Initiative).",
          "type": "string"
        },
        {
          "const": "tcfd",
          "description": "TCFD (Task Force on Climate-related Financial Disclosures).",
          "type": "string"
        },
        {
          "const": "cdp",
          "description": "CDP (Carbon Disclosure Project).",
          "type": "string"
        }
      ]
    },
    "DisclosureStatus": {
      "description": "Disclosure lifecycle.",
      "oneOf": [
        {
          "enum": [
            "draft",
            "in_assurance",
            "filed",
            "published",
            "restated"
          ],
          "type": "string"
        },
        {
          "const": "approved",
          "description": "Approved by board / audit committee.",
          "type": "string"
        }
      ]
    },
    "EsrsTopic": {
      "description": "ESRS topical standard.",
      "oneOf": [
        {
          "const": "esrs_1_general",
          "description": "ESRS 1 — General requirements.",
          "type": "string"
        },
        {
          "const": "esrs_2_general_disclosures",
          "description": "ESRS 2 — General disclosures.",
          "type": "string"
        },
        {
          "const": "esrs_e1_climate",
          "description": "ESRS E1 — Climate change.",
          "type": "string"
        },
        {
          "const": "esrs_e2_pollution",
          "description": "ESRS E2 — Pollution.",
          "type": "string"
        },
        {
          "const": "esrs_e3_water",
          "description": "ESRS E3 — Water and marine resources.",
          "type": "string"
        },
        {
          "const": "esrs_e4_biodiversity",
          "description": "ESRS E4 — Biodiversity and ecosystems.",
          "type": "string"
        },
        {
          "const": "esrs_e5_resources",
          "description": "ESRS E5 — Resource use and circular economy.",
          "type": "string"
        },
        {
          "const": "esrs_s1_workforce",
          "description": "ESRS S1 — Own workforce.",
          "type": "string"
        },
        {
          "const": "esrs_s2_value_chain_workers",
          "description": "ESRS S2 — Workers in the value chain.",
          "type": "string"
        },
        {
          "const": "esrs_s3_communities",
          "description": "ESRS S3 — Affected communities.",
          "type": "string"
        },
        {
          "const": "esrs_s4_consumers",
          "description": "ESRS S4 — Consumers and end-users.",
          "type": "string"
        },
        {
          "const": "esrs_g1_conduct",
          "description": "ESRS G1 — Business conduct.",
          "type": "string"
        }
      ]
    },
    "IsoDate": {
      "description": "ISO 8601 date (YYYY-MM-DD).",
      "format": "date",
      "type": "string"
    },
    "MaterialTopic": {
      "description": "Material topic (output of double-materiality assessment).",
      "properties": {
        "materiality": {
          "$ref": "#/$defs/Materiality"
        },
        "rationale": {
          "type": "string"
        },
        "sub_topics": {
          "description": "Sub-topics covered (e.g. \"GHG emissions\", \"Energy mix\").",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "topic": {
          "$ref": "#/$defs/EsrsTopic",
          "description": "Topical standard."
        }
      },
      "required": [
        "topic",
        "materiality",
        "rationale"
      ],
      "type": "object"
    },
    "Materiality": {
      "description": "Materiality side (CSRD double-materiality).",
      "oneOf": [
        {
          "const": "financial",
          "description": "Effect on enterprise value (outside-in).",
          "type": "string"
        },
        {
          "const": "impact",
          "description": "Effect on planet/people (inside-out).",
          "type": "string"
        },
        {
          "const": "double",
          "description": "Both (double-material).",
          "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/sustainability-disclosure.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Sustainability disclosure record.",
  "properties": {
    "assurance_level": {
      "$ref": "#/$defs/AssuranceLevel"
    },
    "assurance_opinion_ref": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef to assurance opinion artefact."
    },
    "assurance_provider": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "$ref": "#/$defs/IsoDate"
    },
    "emission_inventory_refs": {
      "description": "PathRefs into emission inventory records.",
      "items": {
        "$ref": "#/$defs/PathRef"
      },
      "type": "array"
    },
    "entity": {
      "$ref": "#/$defs/PathRef"
    },
    "filed_at": {
      "anyOf": [
        {
          "$ref": "#/$defs/IsoDate"
        },
        {
          "type": "null"
        }
      ]
    },
    "framework": {
      "$ref": "#/$defs/DisclosureFramework"
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "material_topics": {
      "description": "Result of the (double-)materiality assessment.",
      "items": {
        "$ref": "#/$defs/MaterialTopic"
      },
      "type": "array"
    },
    "published_report": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef to the published report (XBRL or PDF)."
    },
    "reporting_period_end": {
      "$ref": "#/$defs/IsoDate"
    },
    "reporting_period_start": {
      "$ref": "#/$defs/IsoDate"
    },
    "status": {
      "$ref": "#/$defs/DisclosureStatus"
    }
  },
  "required": [
    "id",
    "entity",
    "framework",
    "reporting_period_start",
    "reporting_period_end",
    "material_topics",
    "assurance_level",
    "status",
    "created_at"
  ],
  "title": "SustainabilityDisclosure",
  "type": "object",
  "x-corpospec-pillar": "sustainability"
}