{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zvid-io/json-schema/zvid-io-usage-stats-schema.json",
  "title": "UsageStats",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zvid-io-credits-api-openapi.yml#/components/schemas/UsageStats",
  "type": "object",
  "properties": {
    "timeframe": {
      "type": "string",
      "description": "The timeframe for the statistics"
    },
    "totalSpent": {
      "type": "integer",
      "description": "Total credits spent in the timeframe"
    },
    "totalEarned": {
      "type": "integer",
      "description": "Total credits earned in the timeframe"
    },
    "totalRefunded": {
      "type": "integer",
      "description": "Total credits refunded in the timeframe"
    },
    "dailyUsage": {
      "type": "array",
      "description": "Daily breakdown of credit usage",
      "items": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "description": "Date of the usage"
          },
          "spent": {
            "type": "integer",
            "description": "Credits spent on this day"
          },
          "earned": {
            "type": "integer",
            "description": "Credits earned on this day"
          }
        },
        "required": [
          "date",
          "spent",
          "earned"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "timeframe",
    "totalSpent",
    "totalEarned",
    "totalRefunded",
    "dailyUsage"
  ],
  "additionalProperties": false
}