{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tessio-eu/json-schema/tessio-eu-age-check-stats-series-schema.json",
  "title": "AgeCheckStatsSeries",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tessio-eu-openapi.json#/components/schemas/AgeCheckStatsSeries",
  "type": "object",
  "properties": {
    "mode": {
      "type": "string",
      "enum": [
        "all",
        "live",
        "test"
      ]
    },
    "metric": {
      "type": "string",
      "enum": [
        "checks",
        "expired",
        "failed",
        "pass_rate",
        "passed",
        "under_age"
      ]
    },
    "granularity": {
      "type": "string",
      "enum": [
        "day",
        "hour",
        "month",
        "week"
      ]
    },
    "points": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/StatsPoint"
      }
    },
    "retention": {
      "$ref": "#/$defs/StatsRetention"
    }
  },
  "$defs": {
    "StatsPoint": {
      "type": "object",
      "properties": {
        "bucket": {
          "type": "string",
          "description": "YYYY-MM-DD, or YYYY-MM-DDTHH:00Z for hours (UTC)"
        },
        "value": {
          "type": [
            "number",
            "null"
          ]
        }
      }
    },
    "StatsRetention": {
      "type": "object",
      "description": "The first UTC day the purge has left whole, from what it recorded it may have deleted: after an upgrade the longer plan does not bring back days the shorter one already took. It may understate, never overstate: a day it calls whole is. A range that starts earlier counts only what is still held, so read the older days as partial, not as \"no checks\". Null where no purge has run for the org, so nothing was deleted.",
      "properties": {
        "recordsFrom": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "For the checks: every read."
        },
        "eventsFrom": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "For what is read from each check's timeline: failures, the funnel's step for a fetched request under `eudiw`, held presentations (part of the funnel's `responseReceived`) and `noAnswer`, which leaves out a check whose presentation was held."
        }
      }
    }
  }
}