{
  "$defs": {
    "IsoCurrency": {
      "description": "ISO 4217 currency code.",
      "pattern": "^[A-Z]{3}$",
      "type": "string"
    },
    "IsoDate": {
      "description": "ISO 8601 date (YYYY-MM-DD).",
      "format": "date",
      "type": "string"
    },
    "KpiTarget": {
      "description": "KPI target the round aims to deliver before the next round.",
      "properties": {
        "achieve_by": {
          "$ref": "#/$defs/IsoDate"
        },
        "metric_ref": {
          "$ref": "#/$defs/PathRef",
          "description": "PathRef into a MetricDefinition."
        },
        "target": {
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "metric_ref",
        "target",
        "achieve_by"
      ],
      "type": "object"
    },
    "MilestoneTarget": {
      "description": "Milestone the round is expected to deliver.",
      "properties": {
        "achieve_by": {
          "$ref": "#/$defs/IsoDate"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "label": {
          "type": "string"
        }
      },
      "required": [
        "label",
        "achieve_by"
      ],
      "type": "object"
    },
    "MonetaryAmount": {
      "description": "A monetary value with currency.",
      "properties": {
        "amount": {
          "format": "double",
          "type": "number"
        },
        "currency": {
          "$ref": "#/$defs/IsoCurrency"
        }
      },
      "required": [
        "amount",
        "currency"
      ],
      "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"
    },
    "PlannedHire": {
      "description": "One planned hire allocated against this round.",
      "properties": {
        "annual_comp_total": {
          "$ref": "#/$defs/MonetaryAmount"
        },
        "expected_start": {
          "$ref": "#/$defs/IsoDate"
        },
        "headcount": {
          "format": "int32",
          "type": "integer"
        },
        "role": {
          "$ref": "#/$defs/PathRef",
          "description": "PathRef into `people/roles/<slug>` when the role is defined."
        }
      },
      "required": [
        "role",
        "headcount",
        "expected_start",
        "annual_comp_total"
      ],
      "type": "object"
    },
    "UofAllocation": {
      "description": "One allocation row.",
      "properties": {
        "amount": {
          "$ref": "#/$defs/MonetaryAmount"
        },
        "category": {
          "$ref": "#/$defs/UofCategory"
        },
        "custom_label": {
          "description": "Free-form label when `category: Other`.",
          "type": [
            "string",
            "null"
          ]
        },
        "hires": {
          "items": {
            "$ref": "#/$defs/PlannedHire"
          },
          "type": "array"
        },
        "milestones": {
          "items": {
            "$ref": "#/$defs/MilestoneTarget"
          },
          "type": "array"
        },
        "note": {
          "type": [
            "string",
            "null"
          ]
        },
        "pct": {
          "format": "double",
          "type": "number"
        },
        "vendors": {
          "description": "PathRefs into BDR 0078 Vendor records (committed spend).",
          "items": {
            "$ref": "#/$defs/PathRef"
          },
          "type": "array"
        }
      },
      "required": [
        "category",
        "amount",
        "pct"
      ],
      "type": "object"
    },
    "UofAssumption": {
      "description": "Named assumption underlying the budget.",
      "properties": {
        "description": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "value",
        "description"
      ],
      "type": "object"
    },
    "UofCategory": {
      "description": "Top-level allocation category.",
      "oneOf": [
        {
          "enum": [
            "hiring",
            "product",
            "gtm",
            "infra",
            "legal",
            "reserves"
          ],
          "type": "string"
        },
        {
          "const": "other",
          "description": "Custom category — caller supplies a label.",
          "type": "string"
        }
      ]
    },
    "UofScenario": {
      "description": "Sensitivity scenario.",
      "properties": {
        "description": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "runway_delta_months": {
          "description": "Adjustment to runway in months relative to base case.",
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "name",
        "description",
        "runway_delta_months"
      ],
      "type": "object"
    }
  },
  "$id": "https://corpospec.com/schemas/v0.16.0/use-of-funds.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Use-of-funds record per BDR 0068 §6.",
  "properties": {
    "assumptions": {
      "items": {
        "$ref": "#/$defs/UofAssumption"
      },
      "type": "array"
    },
    "categories": {
      "items": {
        "$ref": "#/$defs/UofAllocation"
      },
      "type": "array"
    },
    "currency": {
      "$ref": "#/$defs/IsoCurrency"
    },
    "entity": {
      "$ref": "#/$defs/PathRef"
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "kpis_to_next_round": {
      "items": {
        "$ref": "#/$defs/KpiTarget"
      },
      "type": "array"
    },
    "note": {
      "type": [
        "string",
        "null"
      ]
    },
    "round_ref": {
      "$ref": "#/$defs/PathRef",
      "description": "PathRef into BDR 0067 Round."
    },
    "runway_months": {
      "format": "double",
      "type": "number"
    },
    "sensitivity_scenarios": {
      "items": {
        "$ref": "#/$defs/UofScenario"
      },
      "type": "array"
    },
    "total_funds": {
      "$ref": "#/$defs/MonetaryAmount"
    }
  },
  "required": [
    "id",
    "round_ref",
    "entity",
    "total_funds",
    "currency",
    "runway_months",
    "categories",
    "kpis_to_next_round",
    "assumptions"
  ],
  "title": "UseOfFunds",
  "type": "object",
  "x-corpospec-pillar": "entity"
}