{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aerocell-app/json-schema/aerocell-app-partner-comparison-catalog-schema.json",
  "title": "PartnerComparisonCatalog",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/aerocell-app-api-openapi.json#/components/schemas/PartnerComparisonCatalog",
  "type": "object",
  "required": [
    "schema_version",
    "provider",
    "currency",
    "price_basis",
    "total_plans",
    "plans",
    "catalog_version",
    "generated_at",
    "source_updated_at",
    "refresh_after_seconds",
    "tracking_enabled"
  ],
  "properties": {
    "schema_version": {
      "type": "integer",
      "const": 1
    },
    "provider": {
      "type": "string",
      "const": "AeroCell"
    },
    "currency": {
      "type": "string",
      "const": "USD"
    },
    "price_basis": {
      "type": "string"
    },
    "total_plans": {
      "type": "integer",
      "minimum": 0
    },
    "plans": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ComparisonPlan"
      }
    },
    "catalog_version": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$",
      "description": "Hash of the underlying public catalog, before partner link decoration."
    },
    "generated_at": {
      "type": "string",
      "format": "date-time",
      "description": "When this content version was generated, not a provider price-change time."
    },
    "source_updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Oldest provider catalog retrieval used in this snapshot. Expired provider data is rejected after 15 minutes."
    },
    "refresh_after_seconds": {
      "type": "integer",
      "const": 900
    },
    "tracking_enabled": {
      "type": "boolean",
      "description": "Whether plan and checkout links carry the registered partner attribution parameter. Existing consent and purchase eligibility rules still apply."
    }
  },
  "additionalProperties": false,
  "$defs": {
    "ComparisonPlan": {
      "type": "object",
      "required": [
        "id",
        "package_code",
        "name",
        "country_codes",
        "data_gb",
        "allowance_period",
        "is_unlimited",
        "allowance_behavior",
        "reduced_speed_kbps",
        "maximum_speed_kbps",
        "validity_days",
        "is_daily",
        "price_usd",
        "operators",
        "plan_page_url",
        "checkout_url"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable variant ID. Fixed plans use package_code; day-pass variants append --<days>d."
        },
        "package_code": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{1,100}$"
        },
        "name": {
          "type": "string"
        },
        "country_codes": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "pattern": "^[A-Z]{2}$"
          },
          "description": "Exact published coverage, not inferred from a region name."
        },
        "data_gb": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "description": "High-speed allowance in binary GB (1024^3 bytes) for allowance_period. This is not a total allowance for daily plans. Null for verified unlimited plans without a finite quota."
        },
        "allowance_period": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "plan",
            "day",
            null
          ]
        },
        "is_unlimited": {
          "type": "boolean",
          "description": "True for daily throttled access and verified unlimited plans; inspect allowance_behavior and speed limits."
        },
        "allowance_behavior": {
          "type": "string",
          "enum": [
            "total",
            "daily_throttled",
            "daily_cutoff",
            "unlimited"
          ],
          "description": "daily_throttled continues at reduced_speed_kbps after each daily high-speed allowance; daily_cutoff stops data until the quota resets."
        },
        "reduced_speed_kbps": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1,
          "description": "Verified post-quota speed for daily_throttled plans, otherwise null."
        },
        "maximum_speed_kbps": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1,
          "description": "Verified initial speed cap if known; null means not specified, not uncapped."
        },
        "validity_days": {
          "type": "integer",
          "minimum": 1
        },
        "is_daily": {
          "type": "boolean",
          "description": "Selectable day pass, expanded into every purchasable duration from 1 to 90 days."
        },
        "price_usd": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Retail total for the selected duration using the same quote as checkout, before coupons."
        },
        "operators": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "network"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "network": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "additionalProperties": false
          },
          "description": "Provider operator summary, not a per-country network map."
        },
        "plan_page_url": {
          "type": "string",
          "format": "uri"
        },
        "checkout_url": {
          "type": "string",
          "format": "uri",
          "description": "Opens checkout with periodNum for day passes. Does not place an order."
        }
      },
      "additionalProperties": false
    }
  }
}