{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/altoviz-com/json-schema/altoviz-com-cash-flow-result-schema.json",
  "title": "CashFlowResult",
  "description": "Cash flow bucketed over a period: what was settled, what is still outstanding, and the two\nadded together. Every list shares the same buckets, so index N is the same period throughout.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/altoviz-com-statistics-api-openapi.yml#/components/schemas/CashFlowResult",
  "type": "object",
  "properties": {
    "expenses": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/PeriodBucketModel"
      },
      "description": "Amounts actually paid out"
    },
    "periodicity": {
      "$ref": "#/$defs/Periodicity"
    },
    "profits": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/PeriodBucketModel"
      },
      "description": "Receipts minus expenses"
    },
    "projectedExpenses": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/PeriodBucketModel"
      },
      "description": "Paid plus still outstanding"
    },
    "projectedProfits": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/PeriodBucketModel"
      },
      "description": "Projected receipts minus projected expenses"
    },
    "projectedReceipts": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/PeriodBucketModel"
      },
      "description": "Received plus still outstanding"
    },
    "range": {
      "$ref": "#/$defs/DateRangeModel"
    },
    "receipts": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/PeriodBucketModel"
      },
      "description": "Amounts actually received"
    },
    "unpaidExpenses": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/PeriodBucketModel"
      },
      "description": "Payables still outstanding"
    },
    "unpaidProfits": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/PeriodBucketModel"
      },
      "description": "Outstanding receivables minus outstanding payables"
    },
    "unpaidReceipts": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/PeriodBucketModel"
      },
      "description": "Receivables still outstanding"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "DateRangeModel": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string",
          "description": "First day of the period",
          "format": "date"
        },
        "to": {
          "type": "string",
          "description": "Last day of the period, included",
          "format": "date"
        }
      },
      "additionalProperties": false,
      "description": "An inclusive date range"
    },
    "PeriodBucketModel": {
      "type": "object",
      "properties": {
        "partial": {
          "type": "boolean",
          "description": "True when the calendar period was clipped by the requested range, so the bucket holds\nless than a full month/quarter/week of activity and must not be compared at face value."
        },
        "range": {
          "$ref": "#/$defs/DateRangeModel"
        },
        "value": {
          "type": "number",
          "description": "Amount (tax excluded)",
          "format": "double"
        }
      },
      "additionalProperties": false,
      "description": "One point of a series, covering a single bucket of the period"
    },
    "Periodicity": {
      "enum": [
        "Daily",
        "Weekly",
        "Monthly",
        "Quarterly",
        "Annually"
      ],
      "type": "string"
    }
  }
}