{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schemas.bakery-ia.com/demo/production/equipment/v1",
  "type": "object",
  "title": "Equipment",
  "description": "Production equipment for demo cloning",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Unique equipment identifier"
    },
    "tenant_id": {
      "type": "string",
      "format": "uuid",
      "description": "Tenant owner (replaced during cloning)"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "type": {
      "type": "string",
      "enum": ["oven", "mixer", "proofer", "freezer", "packaging", "other"]
    },
    "model": {
      "type": ["string", "null"],
      "maxLength": 100
    },
    "serial_number": {
      "type": ["string", "null"],
      "maxLength": 100
    },
    "location": {
      "type": ["string", "null"],
      "maxLength": 255
    },
    "manufacturer": {
      "type": ["string", "null"],
      "maxLength": 100
    },
    "firmware_version": {
      "type": ["string", "null"],
      "maxLength": 50
    },
    "status": {
      "type": "string",
      "enum": ["OPERATIONAL", "MAINTENANCE", "DOWN", "WARNING"],
      "default": "OPERATIONAL"
    },
    "install_date": {
      "type": ["string", "null"],
      "format": "date-time"
    },
    "last_maintenance_date": {
      "type": ["string", "null"],
      "format": "date-time"
    },
    "next_maintenance_date": {
      "type": ["string", "null"],
      "format": "date-time"
    },
    "maintenance_interval_days": {
      "type": ["integer", "null"],
      "minimum": 1
    },
    "efficiency_percentage": {
      "type": ["number", "null"],
      "minimum": 0,
      "maximum": 100
    },
    "uptime_percentage": {
      "type": ["number", "null"],
      "minimum": 0,
      "maximum": 100
    },
    "energy_usage_kwh": {
      "type": ["number", "null"],
      "minimum": 0
    },
    "power_kw": {
      "type": ["number", "null"],
      "minimum": 0
    },
    "capacity": {
      "type": ["number", "null"],
      "minimum": 0
    },
    "weight_kg": {
      "type": ["number", "null"],
      "minimum": 0
    },
    "current_temperature": {
      "type": ["number", "null"]
    },
    "target_temperature": {
      "type": ["number", "null"]
    },
    "iot_enabled": {
      "type": "boolean",
      "default": false
    },
    "iot_protocol": {
      "type": ["string", "null"],
      "enum": ["rest_api", "opc_ua", "mqtt", "modbus", "custom"]
    },
    "iot_endpoint": {
      "type": ["string", "null"],
      "maxLength": 500
    },
    "iot_port": {
      "type": ["integer", "null"],
      "minimum": 1,
      "maximum": 65535
    },
    "iot_connection_status": {
      "type": ["string", "null"],
      "enum": ["connected", "disconnected", "error", "unknown"]
    },
    "iot_last_connected": {
      "type": ["string", "null"],
      "format": "date-time"
    },
    "supports_realtime": {
      "type": "boolean",
      "default": false
    },
    "poll_interval_seconds": {
      "type": ["integer", "null"],
      "minimum": 1
    },
    "temperature_zones": {
      "type": ["integer", "null"],
      "minimum": 1
    },
    "supports_humidity": {
      "type": "boolean",
      "default": false
    },
    "supports_energy_monitoring": {
      "type": "boolean",
      "default": false
    },
    "supports_remote_control": {
      "type": "boolean",
      "default": false
    },
    "is_active": {
      "type": "boolean",
      "default": true
    },
    "notes": {
      "type": ["string", "null"]
    },
    "created_at": {
      "type": ["string", "null"],
      "format": "date-time"
    },
    "updated_at": {
      "type": ["string", "null"],
      "format": "date-time"
    }
  },
  "required": [
    "id", "tenant_id", "name", "type", "status", "is_active"
  ],
  "additionalProperties": false
}