{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/engrate/json-schema/engrate-nlimbalance-summary-response-schema.json",
  "title": "NLImbalanceSummaryResponse",
  "description": "Aggregation of NL imbalance settlement data over a date range.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/engrate-nl-settlement-api-openapi.yml#/components/schemas/NLImbalanceSummaryResponse",
  "properties": {
    "business_type_totals": {
      "description": "Per-business-type aggregated totals.",
      "items": {
        "$ref": "#/$defs/NLBusinessTypeTotalResponse"
      },
      "title": "Business Type Totals",
      "type": "array"
    },
    "date_from": {
      "description": "Start of the queried date range.",
      "format": "date",
      "title": "Date From",
      "type": "string"
    },
    "date_to": {
      "description": "End of the queried date range.",
      "format": "date",
      "title": "Date To",
      "type": "string"
    },
    "days_covered": {
      "description": "Number of distinct report dates.",
      "title": "Days Covered",
      "type": "integer"
    },
    "report_count": {
      "description": "Number of imbalance reports in the range.",
      "title": "Report Count",
      "type": "integer"
    }
  },
  "required": [
    "date_from",
    "date_to",
    "days_covered",
    "report_count"
  ],
  "type": "object",
  "$defs": {
    "NLBusinessTypeTotalResponse": {
      "description": "Aggregated total for a single business type within a month.",
      "properties": {
        "business_type": {
          "description": "Business type code.",
          "title": "Business Type",
          "type": "string"
        },
        "series_count": {
          "description": "Number of time series contributing to the total.",
          "title": "Series Count",
          "type": "integer"
        },
        "total_quantity": {
          "description": "Sum of quantities across all reports.",
          "title": "Total Quantity",
          "type": "number"
        }
      },
      "required": [
        "business_type",
        "series_count",
        "total_quantity"
      ],
      "title": "NLBusinessTypeTotalResponse",
      "type": "object"
    }
  }
}