{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/grepr/json-schema/grepr-daily-table-schema.json",
  "title": "DailyTable",
  "description": "Daily-usage table.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/grepr-billing-api-openapi.yml#/components/schemas/DailyTable",
  "properties": {
    "current": {
      "description": "True when the reporting period contains today. Same semantic as PeriodEntry.current — the last entry of days[] represents an incomplete day, so consumers should mark it as in-progress.",
      "type": "boolean"
    },
    "days": {
      "default": [],
      "description": "The reporting period's days in ascending order.",
      "items": {
        "description": "The reporting period's days in ascending order.",
        "format": "date",
        "type": "string"
      },
      "type": "array"
    },
    "metrics": {
      "default": [],
      "description": "One usage series per metered dimension, in display order. Bricks absent from the configured displayed-brick list are skipped.",
      "items": {
        "$ref": "#/$defs/MeteredDimensionUsage"
      },
      "type": "array"
    }
  },
  "required": [
    "days",
    "metrics"
  ],
  "type": "object",
  "$defs": {
    "MeteredDimensionUsage": {
      "description": "One metered dimension's daily usage and period totals.",
      "properties": {
        "dailyValues": {
          "default": [],
          "description": "Per-day usage counts.",
          "items": {
            "description": "Per-day usage counts.",
            "type": "number"
          },
          "type": "array"
        },
        "label": {
          "description": "Display label for the metered dimension.",
          "type": "string"
        },
        "previousMonthTotal": {
          "description": "This column's total for the prior calendar month; null when no prior-month comparison applies (a partial billing cycle, or no prior month before the contract start). Consumers derive the delta and percent change from this value and {@link #getTotal()}.",
          "type": "number"
        },
        "total": {
          "description": "Sum of the daily values over the reporting period.",
          "type": "number"
        },
        "totalDollars": {
          "description": "Billed dollar amount for the period; null when this column has no unit price.",
          "type": "number"
        }
      },
      "required": [
        "dailyValues",
        "label",
        "total"
      ],
      "type": "object"
    }
  }
}