openapi: 3.0.0
info:
  title: ContaminUS API
  version: 1.0.0
  description: Documentación de la API del proyecto ContaminUS
servers:
  - url: http://localhost:8888
    description: Servidor local de desarrollo
paths:
  /api/v1/groups/{groupId}/devices/{deviceId}/latest-values:
    get:
      summary: Últimos valores de los sensores del dispositivo
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Operación exitosa
  /api/v1/groups/{groupId}/devices/{deviceId}/pollution-map:
    get:
      summary: Mapa de contaminación del dispositivo
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Operación exitosa
  /api/v1/groups/{groupId}/devices/{deviceId}/history:
    get:
      summary: Historial de valores del dispositivo
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Operación exitosa
  /api/v1/groups/{groupId}/devices/{deviceId}/sensors/{sensorId}/values:
    get:
      summary: Valores del sensor
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
        - name: sensorId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Operación exitosa
  /api/raw/v1/groups:
    get:
      summary: Lista de grupos
      responses:
        "200":
          description: Operación exitosa
  /api/raw/v1/groups/{groupId}:
    get:
      summary: Información de un grupo
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Operación exitosa
  /api/raw/v1/groups/{groupId}/devices:
    get:
      summary: Lista de dispositivos de un grupo
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Operación exitosa
  /api/raw/v1/groups/{groupId}/devices/{deviceId}:
    get:
      summary: Información de un dispositivo
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Operación exitosa
  /api/raw/v1/groups/{groupId}/devices/{deviceId}/sensors:
    get:
      summary: Lista de sensores
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Operación exitosa
  /api/raw/v1/groups/{groupId}/devices/{deviceId}/sensors/{sensorId}:
    get:
      summary: Información de un sensor
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
        - name: sensorId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Operación exitosa
  /api/raw/v1/groups/{groupId}/devices/{deviceId}/actuators:
    get:
      summary: Lista de actuadores
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Operación exitosa
  /api/raw/v1/groups/{groupId}/devices/{deviceId}/actuators/{actuatorId}:
    get:
      summary: Información de un actuador
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
        - name: actuatorId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Operación exitosa
  /api/v1/groups/{groupId}/devices/{deviceId}/actuators/{actuatorId}/status:
    get:
      summary: Estado de un actuador
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
        - name: actuatorId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Operación exitosa
  /api/raw/v1/v_latest_values:
    get:
      summary: Vista de últimos valores
      responses:
        "200":
          description: Operación exitosa
  /api/raw/v1/v_pollution_map:
    get:
      summary: Vista de mapa de contaminación
      responses:
        "200":
          description: Operación exitosa
  /api/raw/v1/v_sensor_history_by_device:
    get:
      summary: Vista de historial de sensores
      responses:
        "200":
          description: Operación exitosa
  /api/raw/v1/v_sensor_values:
    get:
      summary: Vista de valores de sensores
      responses:
        "200":
          description: Operación exitosa
  /api/v1/batch:
    post:
      summary: Insertar batch de datos
      responses:
        "200":
          description: Operación exitosa
  /api/raw/v1/groups/{groupId}/devices/{deviceId}/sensors/{sensorId}/gps_values:
    post:
      summary: Insertar valor GPS
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
        - name: sensorId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Operación exitosa
  /api/raw/v1/groups/{groupId}/devices/{deviceId}/sensors/{sensorId}/weather_values:
    post:
      summary: Insertar valor climático
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
        - name: sensorId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Operación exitosa
  /api/raw/v1/groups/{groupId}/devices/{deviceId}/sensors/{sensorId}/co_values:
    post:
      summary: Insertar valor de CO
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
        - name: deviceId
          in: path
          required: true
          schema:
            type: string
        - name: sensorId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Operación exitosa
