openapi: 3.1.0
info:
  title: CarPilot API
  version: 0.0.0
  description: >
    SQUELETTE — À COMPLÉTER. CarPilot 9.0 n'expose pas encore d'API REST publique
    (SPA front-only, données en localStorage). Ce fichier prépare la future API
    (roadmap V2/V3).
servers:
  - url: https://api.carpilot.app/v1
    description: Production (à venir)
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization
  schemas:
    Circuit:
      type: object
      properties:
        id: { type: string }
        nom: { type: string }
        categorie: { type: string, enum: [Aller, Retour] }
        statut: { type: string, enum: [Brouillon, Valide] }
        stops:
          type: array
          items: { $ref: '#/components/schemas/Stop' }
    Stop:
      type: object
      properties:
        id: { type: string }
        nom: { type: string }
        type: { type: string, enum: [RAMASSAGE, DEPOSE, ECOLE, COLLEGE, LYCEE, DEPOT, VIA, HLP] }
        position: { type: array, items: { type: number }, minItems: 2, maxItems: 2 }
        horaire: { type: string }
        passengers: { type: integer }
        isWaypoint: { type: boolean }
    Alert:
      type: object
      properties:
        id: { type: string }
        type: { type: string }
        gravite: { type: string, enum: [Info, Warning, Critical] }
        statut: { type: string, enum: [non_lu, lu, resolu] }
        message: { type: string }
security:
  - apiKey: []
paths: {}   # À COMPLÉTER : /circuits, /circuits/{id}, /alerts, /drivers, webhooks…
