{
  "$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"
    },
    "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"
    },
    "SegmentKind": {
      "description": "What kind of segment this is, per IFRS 8 §11 + ASC 280-10-50-1.",
      "oneOf": [
        {
          "const": "operating",
          "description": "Operating segment — engages in business activities, results are\nregularly reviewed by the CODM. The IFRS 8 primary definition.",
          "type": "string"
        },
        {
          "const": "geographic",
          "description": "Geographic segment.",
          "type": "string"
        },
        {
          "const": "customer_type",
          "description": "Customer-type segment (e.g. enterprise vs SMB vs consumer).",
          "type": "string"
        },
        {
          "const": "product_line",
          "description": "Product-line segment.",
          "type": "string"
        },
        {
          "const": "business_unit",
          "description": "Business-unit segment (when the company organises by BU rather than\nby product or geography).",
          "type": "string"
        }
      ]
    },
    "SegmentStatus": {
      "description": "Operational status of an OperatingSegment record.",
      "enum": [
        "active",
        "restructured",
        "discontinued"
      ],
      "type": "string"
    }
  },
  "$id": "https://corpospec.com/schemas/v0.16.0/operating-segment.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "IFRS 8 / ASC 280 Operating Segment record.\n\nOne record per segment per reporting period. Membership is by PathRef\ninto BDR 0065 plural Product / Brand records, BDR 0064 Entity records,\nand (for geographic segments) ISO 3166-1 country codes. The CODM is\nthe role that reviews segment performance and allocates resources —\nIFRS 8 §7 mandates explicit CODM identification.",
  "properties": {
    "aggregation_basis": {
      "description": "Aggregation basis: free-form rationale for why these members form\none segment (e.g. \"Personal-finance B2C consumer apps, DACH\nretail\"). IFRS 8 §12 management-approach disclosure.",
      "type": "string"
    },
    "codm_ref": {
      "$ref": "#/$defs/PathRef",
      "description": "Chief Operating Decision-Maker PathRef into `people/**`. IFRS 8 §7\n\"the function that allocates resources and assesses performance.\"\nTypically the CEO or a Strategy Committee (for committees, the\nPathRef points at the chair)."
    },
    "effective_from": {
      "$ref": "#/$defs/IsoDate",
      "description": "When this segment became reportable."
    },
    "effective_to": {
      "anyOf": [
        {
          "$ref": "#/$defs/IsoDate"
        },
        {
          "type": "null"
        }
      ],
      "description": "When this segment was retired or restructured (segments restructure;\nthe historical record stays)."
    },
    "id": {
      "$ref": "#/$defs/PathRef",
      "description": "PathRef identifier, conventionally\n`financials/segments/<segment-slug>`."
    },
    "kind": {
      "$ref": "#/$defs/SegmentKind",
      "description": "Segment classification."
    },
    "materiality_threshold_pct": {
      "description": "IFRS 8 §13 + ASC 280-10-50-12 10% materiality threshold. Default\n10.0; override only with rationale documented in\n`aggregation_basis`.",
      "format": "double",
      "maximum": 100.0,
      "minimum": 0.0,
      "type": "number"
    },
    "member_brands": {
      "description": "Brands in this segment.",
      "items": {
        "$ref": "#/$defs/PathRef"
      },
      "type": "array"
    },
    "member_entities": {
      "description": "Entities in this segment (relevant for multi-entity groups).",
      "items": {
        "$ref": "#/$defs/PathRef"
      },
      "type": "array"
    },
    "member_jurisdictions": {
      "description": "Geographic membership for `kind: geographic` segments.",
      "items": {
        "$ref": "#/$defs/IsoCountry"
      },
      "type": "array"
    },
    "member_products": {
      "description": "Products in this segment.",
      "items": {
        "$ref": "#/$defs/PathRef"
      },
      "type": "array"
    },
    "note": {
      "description": "Free-form note.",
      "type": [
        "string",
        "null"
      ]
    },
    "parent": {
      "$ref": "#/$defs/PathRef",
      "description": "PathRef into `entity/<slug>` — the consolidation parent that\nreports this segment."
    },
    "parent_segment": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "Parent segment PathRef when segments are nested."
    },
    "status": {
      "$ref": "#/$defs/SegmentStatus",
      "description": "Status."
    }
  },
  "required": [
    "id",
    "parent",
    "kind",
    "codm_ref",
    "aggregation_basis",
    "materiality_threshold_pct",
    "effective_from",
    "status"
  ],
  "title": "OperatingSegment",
  "type": "object",
  "x-corpospec-pillar": "financials"
}