{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/alert-camp/json-schema/alert-camp-user-with-subscription-schema.json",
  "title": "UserWithSubscription",
  "description": "Schema for user response with subscription status.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/alert-camp-auth-api-openapi.yml#/components/schemas/UserWithSubscription",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "title": "Email"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Display Name"
    },
    "language": {
      "type": "string",
      "pattern": "^(fr|en|es|zh|pt|it|ht|ro|vi|el|tl|ru|hi|ko|pa|pl|de)$",
      "title": "Language",
      "default": "fr"
    },
    "id": {
      "type": "string",
      "title": "Id"
    },
    "phone_number": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Phone Number"
    },
    "photo_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Photo Url"
    },
    "email_notifications_enabled": {
      "type": "boolean",
      "title": "Email Notifications Enabled"
    },
    "push_notifications_enabled": {
      "type": "boolean",
      "title": "Push Notifications Enabled"
    },
    "alerts_paused": {
      "type": "boolean",
      "title": "Alerts Paused"
    },
    "is_active": {
      "type": "boolean",
      "title": "Is Active"
    },
    "total_notifications": {
      "type": "integer",
      "title": "Total Notifications",
      "default": 0
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    },
    "has_active_subscription": {
      "type": "boolean",
      "title": "Has Active Subscription"
    },
    "is_in_trial": {
      "type": "boolean",
      "title": "Is In Trial"
    },
    "trial_days_remaining": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Trial Days Remaining"
    },
    "total_cancellations_detected": {
      "type": "integer",
      "title": "Total Cancellations Detected",
      "default": 0
    },
    "total_availabilities_detected": {
      "type": "integer",
      "title": "Total Availabilities Detected",
      "default": 0
    },
    "terms_accepted": {
      "type": "boolean",
      "title": "Terms Accepted",
      "default": false
    },
    "terms_previously_accepted": {
      "type": "boolean",
      "title": "Terms Previously Accepted",
      "default": false
    },
    "has_push_device": {
      "type": "boolean",
      "title": "Has Push Device",
      "default": false
    }
  },
  "type": "object",
  "required": [
    "email",
    "id",
    "email_notifications_enabled",
    "push_notifications_enabled",
    "alerts_paused",
    "is_active",
    "created_at",
    "updated_at",
    "has_active_subscription",
    "is_in_trial"
  ]
}