{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/alert-camp/json-schema/alert-camp-alert-response-schema.json",
  "title": "AlertResponse",
  "description": "Schema for alert response with campground selections.",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/alert-camp-openapi.json#/components/schemas/AlertResponse",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "user_id": {
      "type": "string",
      "title": "User Id"
    },
    "alert_type": {
      "type": "string",
      "title": "Alert Type",
      "default": "standard"
    },
    "provider": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Provider"
    },
    "park_id": {
      "type": "string",
      "title": "Park Id"
    },
    "park_name": {
      "type": "string",
      "title": "Park Name"
    },
    "date_start": {
      "type": "string",
      "format": "date",
      "title": "Date Start"
    },
    "date_end": {
      "type": "string",
      "format": "date",
      "title": "Date End"
    },
    "days_filter": {
      "type": "string",
      "title": "Days Filter",
      "default": "all"
    },
    "split_stay": {
      "type": "boolean",
      "title": "Split Stay",
      "default": false
    },
    "nights_min": {
      "type": "integer",
      "title": "Nights Min"
    },
    "nights_max": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Nights Max"
    },
    "campground_selections": {
      "items": {
        "$ref": "#/$defs/CampgroundSelectionResponse"
      },
      "type": "array",
      "title": "Campground Selections"
    },
    "is_active": {
      "type": "boolean",
      "title": "Is Active"
    },
    "notify_push": {
      "type": "boolean",
      "title": "Notify Push"
    },
    "notify_email": {
      "type": "boolean",
      "title": "Notify Email"
    },
    "notify_sms": {
      "type": "boolean",
      "title": "Notify Sms",
      "default": false
    },
    "party_size": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Party Size"
    },
    "sub_equipment_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Sub Equipment Id"
    },
    "op_access_point_resource_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Op Access Point Resource Id"
    },
    "tent_pads": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Tent Pads"
    },
    "day_use_cells": {
      "anyOf": [
        {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Day Use Cells"
    },
    "entry_dates": {
      "anyOf": [
        {
          "items": {
            "type": "string",
            "format": "date"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Entry Dates"
    },
    "activity_type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Activity Type"
    },
    "equipment_filter_mode": {
      "type": "string",
      "title": "Equipment Filter Mode",
      "default": "any"
    },
    "has_electricity": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Has Electricity"
    },
    "is_accessible": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Is Accessible"
    },
    "pets_only": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pets Only"
    },
    "is_pull_through": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Is Pull Through"
    },
    "is_tent_only": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Is Tent Only"
    },
    "shade_only": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Shade Only"
    },
    "waterfront_only": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Waterfront Only"
    },
    "booking_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Booking Url"
    },
    "out_of_season": {
      "anyOf": [
        {
          "$ref": "#/$defs/OutOfSeasonHint"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_checked_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Checked At"
    },
    "last_notified_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Notified At"
    },
    "notification_count": {
      "type": "integer",
      "title": "Notification Count"
    },
    "availabilities_found": {
      "type": "integer",
      "title": "Availabilities Found",
      "default": 0
    },
    "cancellations_found": {
      "type": "integer",
      "title": "Cancellations Found",
      "default": 0
    },
    "scan_count": {
      "type": "integer",
      "title": "Scan Count",
      "default": 0
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    },
    "created_via": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Created Via"
    },
    "created_by_agent": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Created By Agent"
    }
  },
  "type": "object",
  "required": [
    "id",
    "user_id",
    "park_id",
    "park_name",
    "date_start",
    "date_end",
    "nights_min",
    "nights_max",
    "is_active",
    "notify_push",
    "notify_email",
    "last_checked_at",
    "last_notified_at",
    "notification_count",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "CampgroundSelectionResponse": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "campground_id": {
          "type": "string",
          "title": "Campground Id"
        },
        "zone_ids": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Zone Ids"
        },
        "site_ids": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Site Ids"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "type": "object",
      "required": [
        "id",
        "campground_id",
        "created_at",
        "updated_at"
      ],
      "title": "CampgroundSelectionResponse",
      "description": "Schema for campground selection in response."
    },
    "OutOfSeasonHint": {
      "properties": {
        "season_start": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Season Start"
        },
        "season_end": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Season End"
        },
        "distinct_seasons": {
          "type": "integer",
          "title": "Distinct Seasons"
        },
        "sites_checked": {
          "type": "integer",
          "title": "Sites Checked"
        }
      },
      "type": "object",
      "required": [
        "distinct_seasons",
        "sites_checked"
      ],
      "title": "OutOfSeasonHint",
      "description": "Why an alert's dates cannot match: every watched site is out of season.\n\nThe dates are reported ONLY when every watched site shares one season, and\nare NULL otherwise.  An aggregate across differing seasons contradicts its\nown message: a site open Jan-Mar beside one open Sep-Dec spans the whole\nyear, so a June request would be told it falls outside \"Jan 1 - Dec 31\".\nWidening to the union, or narrowing to the intersection, is wrong in the\nsame way — only unanimity can be stated as a single range.\n\n``distinct_seasons`` lets the app choose its wording: one season gets\n\"this park runs May-October\", several get \"none of the N sites you picked\nare open then\".  ``sites_checked`` counts how much of the selection had a\nknown season at all, so the app can soften when it is a small fraction."
    }
  }
}