{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/alert-camp/json-schema/alert-camp-subscription-status-response-schema.json",
  "title": "SubscriptionStatusResponse",
  "description": "Schema for subscription status check response.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/alert-camp-subscriptions-api-openapi.yml#/components/schemas/SubscriptionStatusResponse",
  "properties": {
    "is_active": {
      "type": "boolean",
      "title": "Is Active"
    },
    "is_trial": {
      "type": "boolean",
      "title": "Is Trial"
    },
    "status": {
      "$ref": "#/$defs/SubscriptionStatusEnum"
    },
    "plan": {
      "anyOf": [
        {
          "$ref": "#/$defs/SubscriptionPlanEnum"
        },
        {
          "type": "null"
        }
      ]
    },
    "tier": {
      "allOf": [
        {
          "$ref": "#/$defs/SubscriptionTierEnum"
        }
      ],
      "default": "essai"
    },
    "pending_tier": {
      "anyOf": [
        {
          "$ref": "#/$defs/SubscriptionTierEnum"
        },
        {
          "type": "null"
        }
      ]
    },
    "trial_days_remaining": {
      "type": "integer",
      "title": "Trial Days Remaining"
    },
    "current_period_end": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ],
      "title": "Current Period End"
    },
    "entitlements": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Entitlements",
      "default": []
    },
    "limits": {
      "anyOf": [
        {
          "$ref": "#/$defs/TierLimitsResponse"
        },
        {
          "type": "null"
        }
      ]
    },
    "usage": {
      "anyOf": [
        {
          "$ref": "#/$defs/QuotaUsageResponse"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "required": [
    "is_active",
    "is_trial",
    "status",
    "plan",
    "trial_days_remaining",
    "current_period_end"
  ],
  "$defs": {
    "QuotaUsageResponse": {
      "properties": {
        "active_alerts": {
          "type": "integer",
          "title": "Active Alerts"
        },
        "total_alerts": {
          "type": "integer",
          "title": "Total Alerts"
        },
        "total_sites": {
          "type": "integer",
          "title": "Total Sites"
        },
        "total_sites_by_bucket": {
          "additionalProperties": {
            "type": "integer"
          },
          "type": "object",
          "title": "Total Sites By Bucket"
        }
      },
      "type": "object",
      "required": [
        "active_alerts",
        "total_alerts",
        "total_sites"
      ],
      "title": "QuotaUsageResponse",
      "description": "Schema for current quota usage."
    },
    "SubscriptionPlanEnum": {
      "type": "string",
      "enum": [
        "monthly"
      ],
      "const": "monthly",
      "title": "SubscriptionPlanEnum",
      "description": "Available subscription plans."
    },
    "SubscriptionStatusEnum": {
      "type": "string",
      "enum": [
        "trial",
        "active",
        "past_due",
        "canceled",
        "expired"
      ],
      "title": "SubscriptionStatusEnum",
      "description": "Subscription status states."
    },
    "SubscriptionTierEnum": {
      "type": "string",
      "enum": [
        "essai",
        "regular",
        "pro"
      ],
      "title": "SubscriptionTierEnum",
      "description": "Subscription tier levels."
    },
    "TierLimitsResponse": {
      "properties": {
        "max_alerts": {
          "type": "integer",
          "title": "Max Alerts"
        },
        "max_sites_per_alert": {
          "type": "integer",
          "title": "Max Sites Per Alert"
        },
        "max_total_sites": {
          "type": "integer",
          "title": "Max Total Sites"
        },
        "max_total_alerts": {
          "type": "integer",
          "title": "Max Total Alerts"
        },
        "sms_enabled": {
          "type": "boolean",
          "title": "Sms Enabled"
        },
        "email_enabled": {
          "type": "boolean",
          "title": "Email Enabled"
        },
        "ontario_parks_enabled": {
          "type": "boolean",
          "title": "Ontario Parks Enabled"
        }
      },
      "type": "object",
      "required": [
        "max_alerts",
        "max_sites_per_alert",
        "max_total_sites",
        "max_total_alerts",
        "sms_enabled",
        "email_enabled",
        "ontario_parks_enabled"
      ],
      "title": "TierLimitsResponse",
      "description": "Schema for tier limits."
    }
  }
}