{
  "$defs": {
    "ChangelogEntry": {
      "description": "A changelog entry recording a dated change.",
      "properties": {
        "change": {
          "type": [
            "string",
            "null"
          ]
        },
        "date": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "DualCurrencyPlan": {
      "description": "Dual currency pricing plan.",
      "properties": {
        "activation": {
          "type": [
            "string",
            "null"
          ]
        },
        "alignment": {
          "type": [
            "string",
            "null"
          ]
        },
        "initial": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "FxAssumption": {
      "description": "FX assumption used in market sizing calculations.",
      "properties": {
        "basis": {
          "type": [
            "string",
            "null"
          ]
        },
        "rate": {
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "rounding": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "IsoCurrency": {
      "description": "ISO 4217 currency code.",
      "pattern": "^[A-Z]{3}$",
      "type": "string"
    },
    "IsoDate": {
      "description": "ISO 8601 date (YYYY-MM-DD).",
      "format": "date",
      "type": "string"
    },
    "MarketSegment": {
      "additionalProperties": false,
      "description": "Market segment (TAM/SAM/SOM).",
      "properties": {
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "methodology": {
          "type": "string"
        },
        "value": {
          "format": "double",
          "minimum": 0.0,
          "type": "number"
        }
      },
      "required": [
        "value",
        "methodology"
      ],
      "type": "object"
    },
    "MarketSizingCustom": {
      "description": "Typed custom extension data for `MarketSizing`.",
      "properties": {
        "changelog": {
          "items": {
            "$ref": "#/$defs/ChangelogEntry"
          },
          "type": "array"
        },
        "dual_currency_plan": {
          "anyOf": [
            {
              "$ref": "#/$defs/DualCurrencyPlan"
            },
            {
              "type": "null"
            }
          ]
        },
        "fx_assumption": {
          "anyOf": [
            {
              "$ref": "#/$defs/FxAssumption"
            },
            {
              "type": "null"
            }
          ]
        },
        "gdpr_moat_reference": {
          "type": [
            "string",
            "null"
          ]
        },
        "geography_breakdown": {
          "additionalProperties": true,
          "description": "Geography breakdown — keys are region slugs, values are region details.",
          "type": [
            "object",
            "null"
          ]
        },
        "icp_alignment": {
          "type": [
            "string",
            "null"
          ]
        },
        "segment_breakdown": {
          "additionalProperties": true,
          "description": "Segment breakdown — keys are segment slugs, values are segment details.",
          "type": [
            "object",
            "null"
          ]
        },
        "som_breakdown": {
          "additionalProperties": true,
          "description": "SOM breakdown — keys are segment slugs, values are { customers, avg_arr_eur, arr_eur }.",
          "type": [
            "object",
            "null"
          ]
        },
        "value_stated": {
          "anyOf": [
            {
              "$ref": "#/$defs/ValueStated"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "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"
    },
    "ValueStated": {
      "description": "Stated values for TAM/SAM/SOM before calculation.",
      "properties": {
        "sam": {
          "type": [
            "string",
            "null"
          ]
        },
        "som": {
          "type": [
            "string",
            "null"
          ]
        },
        "tam": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    }
  },
  "$id": "https://corpospec.com/schemas/v0.7.1/market-sizing.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "TAM/SAM/SOM market sizing model.",
  "properties": {
    "as_of": {
      "anyOf": [
        {
          "$ref": "#/$defs/IsoDate"
        },
        {
          "type": "null"
        }
      ]
    },
    "currency": {
      "$ref": "#/$defs/IsoCurrency"
    },
    "custom": {
      "anyOf": [
        {
          "$ref": "#/$defs/MarketSizingCustom"
        },
        {
          "type": "null"
        }
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "sam": {
      "$ref": "#/$defs/MarketSegment"
    },
    "som": {
      "$ref": "#/$defs/MarketSegment"
    },
    "tam": {
      "$ref": "#/$defs/MarketSegment"
    }
  },
  "required": [
    "id",
    "currency",
    "tam",
    "sam",
    "som"
  ],
  "title": "MarketSizing",
  "type": "object"
}