get:
  operationId: getSiteById
  tags:
    - sites
  summary: Retourne un site
  parameters:
    - $ref: '#/components/parameters/siteId'
  responses:
    200:
      description: OK
      content:
        application/json:
          schema:
            allOf:
              - $ref: '../schemas/Site.yaml'
              - type: object
                properties:
                  platform:
                    $ref: '../schemas/Platform.yaml'
                  company:
                    $ref: '../schemas/Company.yaml'
                  wms:
                    $ref: '../schemas/Warehouse.yaml'

put:
  operationId: putSiteById
  tags:
    - sites
  summary: Modifie un site
  parameters:
    - $ref: '#/components/parameters/siteId'
  requestBody:
    required: true
    content:
      application/json:
        schema:
          type: object
          properties:
            name:
              type: string
            url:
              type: string
            platform:
              type: object
              properties:
                id:
                  type: integer
            company:
              type: object
              properties:
                id:
                  type: string
            wms:
              type: object
              properties:
                id:
                  type: string
  responses:
    200:
      description: OK
      content:
        application/json:
          schema:
            allOf:
              - $ref: '../schemas/Site.yaml'
              - type: object
                properties:
                  platform:
                    $ref: '../schemas/Platform.yaml'
                  company:
                    $ref: '../schemas/Company.yaml'
                  wms:
                    $ref: '../schemas/Warehouse.yaml'
delete:
  operationId: deleteSiteById
  tags:
    - sites
  summary: Supprimer un site
  parameters:
    - $ref: '#/components/parameters/siteId'
  responses:
    204:
      description: Supprimé

components:
  parameters:
    siteId:
      in: path
      name: siteId
      required: true
      description: UUID du site
      schema:
        type: string
