{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/assetlab-ca/json-schema/assetlab-ca-budget-schema.json",
  "title": "Budget",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/assetlab-ca-budgets-api-openapi.yml#/components/schemas/Budget",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "year": {
      "type": "integer"
    },
    "site_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "building_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "funding_source": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "O&M",
        "Capital"
      ],
      "description": "The Budget tab reads one row per year, funding source and module"
    },
    "module": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "facilities",
        "infrastructure"
      ],
      "description": "Workspace; null is organization-wide"
    },
    "allocated_amount": {
      "type": [
        "number",
        "null"
      ],
      "description": "Money in the organization's currency - GET /v1/organization-settings for currency_code"
    },
    "budgeted_amount": {
      "type": [
        "number",
        "null"
      ],
      "description": "Money in the organization's currency - GET /v1/organization-settings for currency_code"
    },
    "remaining_amount": {
      "type": [
        "number",
        "null"
      ],
      "description": "Money in the organization's currency - GET /v1/organization-settings for currency_code"
    },
    "created_by": {
      "type": [
        "string",
        "null"
      ],
      "description": "Clerk user ID"
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "updated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  }
}