{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/Area",
  "title": "Area",
  "type": "object",
  "description": "Geographic area to verify device presence within.",
  "properties": {
    "areaType": {
      "type": "string",
      "enum": [
        "CIRCLE",
        "POLYGON"
      ]
    },
    "center": {
      "type": "object",
      "description": "Center point for circular areas.",
      "properties": {
        "latitude": {
          "type": "number",
          "format": "double",
          "minimum": -90,
          "maximum": 90
        },
        "longitude": {
          "type": "number",
          "format": "double",
          "minimum": -180,
          "maximum": 180
        }
      }
    },
    "radius": {
      "type": "number",
      "format": "double",
      "description": "Radius in meters for circular areas.",
      "minimum": 2000
    },
    "polygon": {
      "type": "array",
      "description": "Polygon vertices for polygon area type.",
      "items": {
        "type": "object",
        "properties": {
          "latitude": {
            "type": "number",
            "format": "double"
          },
          "longitude": {
            "type": "number",
            "format": "double"
          }
        }
      }
    }
  }
}