{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "title": "Aggregates: counts per level, stop and stage",
 "description": "Counts over the products table: overall, per area and per category.",
 "x-table": "aggregates",
 "x-schema-version": "1.1.0",
 "x-license": "CC-BY-4.0",
 "type": "object",
 "properties": {
  "schema_version": {
   "type": "string",
   "const": "1.1.0",
   "description": "The version of this table's schema (semver). Additive changes only within a year; a removal is announced 90 days ahead."
  },
  "scope": {
   "type": "string",
   "enum": [
    "all",
    "area",
    "category"
   ]
  },
  "scope_id": {
   "type": [
    "string",
    "null"
   ],
   "description": "The area's or category's slug; null for all."
  },
  "measure": {
   "type": "string",
   "description": "What is counted: products, level_0 … level_5, gets_in_alone, stop_<checkpoint>, <stage>_<state>."
  },
  "n": {
   "type": "integer"
  },
  "of": {
   "type": "integer",
   "description": "The products in the scope."
  },
  "share": {
   "type": "number",
   "minimum": 0,
   "maximum": 1,
   "description": "n / of, rounded to 4 places."
  }
 },
 "required": [
  "schema_version",
  "scope",
  "scope_id",
  "measure",
  "n",
  "of",
  "share"
 ],
 "additionalProperties": false
}
