{
  "$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"
        }
      ]
    },
    "EmissionLine": {
      "description": "One emission line item.",
      "properties": {
        "activity": {
          "description": "Activity description.",
          "type": "string"
        },
        "activity_quantity": {
          "description": "Activity data quantity (e.g. 12_000.0 kWh, 350.0 km).",
          "format": "double",
          "type": "number"
        },
        "activity_unit": {
          "description": "Activity unit (e.g. \"kWh\", \"km\", \"EUR-spend\").",
          "type": "string"
        },
        "emission_factor_kg_co2e": {
          "description": "Emission factor (kg CO2e per activity unit).",
          "format": "double",
          "type": "number"
        },
        "factor_source": {
          "description": "Emission-factor source (e.g. \"DEFRA 2025\", \"EPA eGRID 2024\",\n\"supplier-specific PPA\").",
          "type": "string"
        },
        "scope": {
          "$ref": "#/$defs/EmissionScope"
        },
        "scope2_method": {
          "anyOf": [
            {
              "$ref": "#/$defs/Scope2Method"
            },
            {
              "type": "null"
            }
          ],
          "description": "For Scope 2: which method (None for Scope 1/3)."
        },
        "scope3_category": {
          "anyOf": [
            {
              "$ref": "#/$defs/Scope3Category"
            },
            {
              "type": "null"
            }
          ],
          "description": "For Scope 3: which category (None for Scope 1/2)."
        },
        "tco2e": {
          "description": "Resulting emissions in tonnes CO2-equivalent.",
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "scope",
        "activity",
        "activity_quantity",
        "activity_unit",
        "emission_factor_kg_co2e",
        "tco2e",
        "factor_source"
      ],
      "type": "object"
    },
    "EmissionScope": {
      "description": "Emission scope.",
      "oneOf": [
        {
          "const": "scope1",
          "description": "Scope 1 — direct GHG from owned/controlled sources.",
          "type": "string"
        },
        {
          "const": "scope2",
          "description": "Scope 2 — purchased electricity, steam, heat, cooling.",
          "type": "string"
        },
        {
          "const": "scope3",
          "description": "Scope 3 — all other indirect emissions in the value chain.",
          "type": "string"
        }
      ]
    },
    "IsoDate": {
      "description": "ISO 8601 date (YYYY-MM-DD).",
      "format": "date",
      "type": "string"
    },
    "OrganisationalBoundary": {
      "description": "Organisational boundary (GHGP §3.1).",
      "oneOf": [
        {
          "const": "equity_share",
          "description": "Equity-share approach.",
          "type": "string"
        },
        {
          "const": "operational_control",
          "description": "Operational-control approach (most common).",
          "type": "string"
        },
        {
          "const": "financial_control",
          "description": "Financial-control approach.",
          "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"
    },
    "Scope2Method": {
      "description": "Scope 2 reporting method (dual-reporting mandate per GHGP Scope 2\nGuidance).",
      "oneOf": [
        {
          "const": "location_based",
          "description": "Grid-average emission factor.",
          "type": "string"
        },
        {
          "const": "market_based",
          "description": "Contract-based (PPAs, RECs, GoOs).",
          "type": "string"
        }
      ]
    },
    "Scope3Category": {
      "description": "Scope 3 category (GHGP — 15 categories).",
      "oneOf": [
        {
          "const": "purchased_goods_services",
          "description": "Cat. 1 — purchased goods and services.",
          "type": "string"
        },
        {
          "const": "capital_goods",
          "description": "Cat. 2 — capital goods.",
          "type": "string"
        },
        {
          "const": "fuel_energy_activities",
          "description": "Cat. 3 — fuel- and energy-related activities not in S1/S2.",
          "type": "string"
        },
        {
          "const": "upstream_transport",
          "description": "Cat. 4 — upstream transportation and distribution.",
          "type": "string"
        },
        {
          "const": "waste_operations",
          "description": "Cat. 5 — waste generated in operations.",
          "type": "string"
        },
        {
          "const": "business_travel",
          "description": "Cat. 6 — business travel.",
          "type": "string"
        },
        {
          "const": "employee_commuting",
          "description": "Cat. 7 — employee commuting.",
          "type": "string"
        },
        {
          "const": "upstream_leased_assets",
          "description": "Cat. 8 — upstream leased assets.",
          "type": "string"
        },
        {
          "const": "downstream_transport",
          "description": "Cat. 9 — downstream transportation and distribution.",
          "type": "string"
        },
        {
          "const": "processing_sold_products",
          "description": "Cat. 10 — processing of sold products.",
          "type": "string"
        },
        {
          "const": "use_sold_products",
          "description": "Cat. 11 — use of sold products.",
          "type": "string"
        },
        {
          "const": "end_of_life",
          "description": "Cat. 12 — end-of-life treatment of sold products.",
          "type": "string"
        },
        {
          "const": "downstream_leased_assets",
          "description": "Cat. 13 — downstream leased assets.",
          "type": "string"
        },
        {
          "const": "franchises",
          "description": "Cat. 14 — franchises.",
          "type": "string"
        },
        {
          "const": "investments",
          "description": "Cat. 15 — investments.",
          "type": "string"
        }
      ]
    }
  },
  "$id": "https://corpospec.com/schemas/v0.16.0/emissions-inventory.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Annual GHG emissions inventory.",
  "properties": {
    "assurance_level": {
      "$ref": "#/$defs/AssuranceLevel"
    },
    "assurance_provider": {
      "type": [
        "string",
        "null"
      ]
    },
    "base_year": {
      "description": "Base year (for trajectory tracking).",
      "format": "int32",
      "type": "integer"
    },
    "created_at": {
      "$ref": "#/$defs/IsoDate"
    },
    "entity": {
      "$ref": "#/$defs/PathRef"
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "lines": {
      "items": {
        "$ref": "#/$defs/EmissionLine"
      },
      "type": "array"
    },
    "methodology": {
      "description": "Methodology notes (e.g. \"GHGP Corporate Standard + Scope 3\nStandard; emissions factors per DEFRA 2025\").",
      "type": "string"
    },
    "organisational_boundary": {
      "$ref": "#/$defs/OrganisationalBoundary"
    },
    "published_report": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef to the published inventory report."
    },
    "reporting_period_end": {
      "$ref": "#/$defs/IsoDate"
    },
    "reporting_period_start": {
      "$ref": "#/$defs/IsoDate"
    }
  },
  "required": [
    "id",
    "entity",
    "reporting_period_start",
    "reporting_period_end",
    "organisational_boundary",
    "lines",
    "assurance_level",
    "methodology",
    "base_year",
    "created_at"
  ],
  "title": "EmissionsInventory",
  "type": "object",
  "x-corpospec-pillar": "sustainability"
}