{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://api-evangelist.github.io/wec-energy/json-schema/wec-energy-outage-schema.json",
  "title": "WEC Energy Group Outage Event",
  "description": "JSON Schema for an electricity outage event reported by WEC Energy Group utilities. Used in the outage map and customer notification systems.",
  "type": "object",
  "properties": {
    "outageId": {
      "type": "string",
      "description": "Unique identifier for this outage event"
    },
    "utility": {
      "type": "string",
      "enum": ["We Energies", "Wisconsin Public Service", "Upper Michigan Energy Resources"],
      "description": "The electric utility reporting this outage"
    },
    "status": {
      "type": "string",
      "enum": ["Active", "Restored", "Under Investigation"],
      "description": "Current status of the outage"
    },
    "cause": {
      "type": "string",
      "enum": ["Weather", "Equipment Failure", "Vehicle Accident", "Tree/Vegetation", "Animals", "Planned Outage", "Under Investigation"],
      "description": "Reported cause of the outage"
    },
    "customersAffected": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of customers affected by this outage"
    },
    "location": {
      "type": "object",
      "description": "Geographic location of the outage",
      "properties": {
        "latitude": {"type": "number", "minimum": -90, "maximum": 90},
        "longitude": {"type": "number", "minimum": -180, "maximum": 180},
        "county": {"type": "string"},
        "state": {"type": "string", "enum": ["WI", "MI"]},
        "municipality": {"type": "string"}
      }
    },
    "reportedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp when the outage was first reported"
    },
    "estimatedRestoration": {
      "type": "string",
      "format": "date-time",
      "description": "Estimated time of restoration (ETR)"
    },
    "restoredAt": {
      "type": "string",
      "format": "date-time",
      "description": "Actual time the outage was restored (if restored)"
    },
    "crewDispatched": {
      "type": "boolean",
      "description": "Whether a crew has been dispatched to investigate or repair"
    },
    "plannedOutage": {
      "type": "boolean",
      "description": "Whether this is a planned maintenance outage with advance notice"
    }
  },
  "required": ["outageId", "utility", "status", "customersAffected", "reportedAt"]
}
