{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/unicum-gg/json-schema/unicum-gg-coverage-schema.json",
  "title": "Coverage",
  "description": "Tracker coverage for one region: row counts, refresh-policy health, 30-day discovery/snapshot trends and infrastructure size/cost.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/unicum-gg-openapi.json#/components/schemas/Coverage",
  "type": "object",
  "properties": {
    "region": {
      "type": "string",
      "enum": [
        "eu",
        "na",
        "asia"
      ]
    },
    "players": {
      "type": "number"
    },
    "clans": {
      "type": "number"
    },
    "playerSnapshots": {
      "type": "number"
    },
    "tankSnapshots": {
      "type": "number"
    },
    "clanMembers": {
      "type": "number"
    },
    "clanRecentEvents": {
      "type": "number"
    },
    "clanRefreshQueue": {
      "type": "number"
    },
    "playerRefreshQueue": {
      "type": "number"
    },
    "snapshotBacklog": {
      "type": "number"
    },
    "activity": {
      "type": "object",
      "properties": {
        "lastPlayerSnapshotAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "lastClanRefreshAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "playerSnapshotsLast24h": {
          "type": "number"
        },
        "clansRefreshedLast24h": {
          "type": "number"
        },
        "snapshotFreshness": {
          "type": "object",
          "properties": {
            "onTime": {
              "type": "number"
            },
            "fetched": {
              "type": "number"
            }
          },
          "required": [
            "onTime",
            "fetched"
          ]
        },
        "awaitingFirstSnapshot": {
          "type": "number"
        }
      },
      "required": [
        "lastPlayerSnapshotAt",
        "lastClanRefreshAt",
        "playerSnapshotsLast24h",
        "clansRefreshedLast24h",
        "snapshotFreshness",
        "awaitingFirstSnapshot"
      ]
    },
    "refreshPolicy": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/refreshPolicyBucket"
      }
    },
    "funFacts": {
      "type": "object",
      "properties": {
        "oldestPlayerSnapshotAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "modUsers": {
          "type": "number",
          "description": "Accounts on this region that have run the unicum.gg mod: every account that sent a battle or a garage loadout."
        },
        "modBattles": {
          "type": "number",
          "description": "Battles the mod has sent on this region."
        },
        "totalBattlesTracked": {
          "type": "number"
        },
        "discordServers": {
          "type": [
            "number",
            "null"
          ],
          "description": "Discord servers our bot is in. Global, not per region. Null when Discord could not be reached."
        }
      },
      "required": [
        "oldestPlayerSnapshotAt",
        "modUsers",
        "modBattles",
        "totalBattlesTracked",
        "discordServers"
      ]
    },
    "trends": {
      "type": "object",
      "properties": {
        "playersDiscoveredDaily": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/dailyPoint"
          }
        },
        "clansDiscoveredDaily": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/dailyPoint"
          }
        },
        "playerSnapshotsDaily": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/dailyPoint"
          }
        },
        "firstSnapshotsDaily": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/dailyPoint"
          }
        }
      },
      "required": [
        "playersDiscoveredDaily",
        "clansDiscoveredDaily",
        "playerSnapshotsDaily",
        "firstSnapshotsDaily"
      ]
    },
    "infrastructure": {
      "type": "object",
      "properties": {
        "databaseBytes": {
          "type": "number"
        },
        "tables": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "bytes": {
                "type": "number"
              }
            },
            "required": [
              "name",
              "bytes"
            ]
          }
        },
        "costs": {
          "type": "object",
          "properties": {
            "recurring": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/expenseLine"
              }
            },
            "past": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/expenseLine"
              }
            },
            "oneOff": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "eur": {
                    "type": "number"
                  },
                  "incurredAt": {
                    "type": "string"
                  },
                  "note": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "eur",
                  "incurredAt"
                ]
              }
            },
            "totalAnnualEur": {
              "type": "number"
            },
            "totalOneOffEur": {
              "type": "number"
            }
          },
          "required": [
            "recurring",
            "past",
            "oneOff",
            "totalAnnualEur",
            "totalOneOffEur"
          ]
        }
      },
      "required": [
        "databaseBytes",
        "tables",
        "costs"
      ]
    }
  },
  "required": [
    "region",
    "players",
    "clans",
    "playerSnapshots",
    "tankSnapshots",
    "clanMembers",
    "clanRecentEvents",
    "clanRefreshQueue",
    "playerRefreshQueue",
    "snapshotBacklog",
    "activity",
    "refreshPolicy",
    "funFacts",
    "trends",
    "infrastructure"
  ],
  "$defs": {
    "dailyPoint": {
      "type": "object",
      "properties": {
        "day": {
          "type": "string",
          "description": "UTC day, YYYY-MM-DD."
        },
        "count": {
          "type": "number"
        }
      },
      "required": [
        "day",
        "count"
      ]
    },
    "expenseLine": {
      "type": "object",
      "properties": {
        "label": {
          "type": "string"
        },
        "eurPerCharge": {
          "type": "number",
          "description": "What a single charge costs. Subscriptions are prepaid, so the cumulative spend counts whole charges, never fractions of them."
        },
        "chargesPerYear": {
          "type": "number",
          "description": "Charges in a year: 12 monthly, 1 yearly."
        },
        "eurAnnual": {
          "type": "number"
        },
        "eurMonthly": {
          "type": "number"
        },
        "from": {
          "type": "string",
          "description": "UTC day it started, YYYY-MM-DD."
        },
        "to": {
          "type": [
            "string",
            "null"
          ],
          "description": "UTC day it stopped, or null while still billed."
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "label",
        "eurPerCharge",
        "chargesPerYear",
        "eurAnnual",
        "eurMonthly",
        "from",
        "to"
      ]
    },
    "refreshPolicyBucket": {
      "type": "object",
      "properties": {
        "bucket": {
          "type": "string",
          "enum": [
            "unfetched",
            "hidden",
            "active_24h",
            "active_7d",
            "recent_30d",
            "recent_90d",
            "dormant_1y",
            "inactive"
          ]
        },
        "cadenceMs": {
          "type": "number",
          "description": "Target refresh cadence for this activity bucket, in ms."
        },
        "total": {
          "type": "number"
        },
        "onTime": {
          "type": "number"
        },
        "neverSnapped": {
          "type": "number"
        }
      },
      "required": [
        "bucket",
        "cadenceMs",
        "total",
        "onTime",
        "neverSnapped"
      ]
    }
  }
}