{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/engrate/json-schema/engrate-aggregate-allocations-response-schema.json",
  "title": "AggregateAllocationsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/engrate-time-series-api-openapi.yml#/components/schemas/AggregateAllocationsResponse",
  "properties": {
    "values": {
      "items": {
        "$ref": "#/$defs/AggregateAllocationRecord"
      },
      "title": "Values",
      "type": "array"
    }
  },
  "required": [
    "values"
  ],
  "type": "object",
  "$defs": {
    "AggregateAllocationRecord": {
      "description": "A volume for one aggregate timeseries and one Imbalance Settlement Period (ISP).",
      "properties": {
        "external_id": {
          "title": "External Id",
          "type": "string"
        },
        "finality": {
          "$ref": "#/$defs/Finality"
        },
        "flow_direction": {
          "enum": [
            "consumption",
            "production"
          ],
          "title": "Flow Direction",
          "type": "string"
        },
        "isp_resolution_minutes": {
          "title": "Isp Resolution Minutes",
          "type": "integer"
        },
        "isp_time": {
          "format": "date-time",
          "title": "Isp Time",
          "type": "string"
        },
        "known_at": {
          "format": "date-time",
          "title": "Known At",
          "type": "string"
        },
        "quality": {
          "$ref": "#/$defs/AllocationQuality"
        },
        "volume_wh": {
          "title": "Volume Wh",
          "type": "integer"
        }
      },
      "required": [
        "external_id",
        "finality",
        "flow_direction",
        "isp_resolution_minutes",
        "isp_time",
        "known_at",
        "quality",
        "volume_wh"
      ],
      "title": "AggregateAllocationRecord",
      "type": "object"
    },
    "AllocationQuality": {
      "description": "How the volume was arrived at, in ascending order of trust. When one settlement period carries several records, prefer the highest quality.\n\n### Available allocation qualities\n\n- **provisional** — A placeholder the sender intends to replace.\n\n- **estimated** — Substituted because no reading was available: profiled, interpolated, or copied from a comparable period. Expect it to be superseded.\n\n- **calculated** — Derived by a defined computation rather than read\n\n- **measured** — Read off the meter.",
      "enum": [
        "provisional",
        "estimated",
        "calculated",
        "measured"
      ],
      "title": "AllocationQuality",
      "type": "string"
    },
    "Finality": {
      "description": "The settlement data comes in different levels of \"finality\". Each market has its own names for these levels, and all of them map to this common ladder. When one settlement period has more than one record, use the record with the highest finality, then the latest `known_at`.\n\n### Available finalities\n\n- **preliminary** — The first level, sent before the market has all the data.\n\n- **revised** — The level used for corrections to the preliminary data.\n\n- **final** — The level used for settlement and invoicing.\n\n- **correction** — The level used for corrections when the final value was wrong. A correction replaces the final value.",
      "enum": [
        "preliminary",
        "revised",
        "final",
        "correction"
      ],
      "title": "Finality",
      "type": "string"
    }
  }
}