---
/acquisitions/baskets:
  get:
    x-mojo-to: Acquisitions::Baskets#list
    operationId: listBaskets
    description: This resource returns a list of baskets
    summary: List of baskets
    tags:
      - baskets
    parameters:
      - $ref: "../swagger.yaml#/parameters/match"
      - $ref: "../swagger.yaml#/parameters/order_by"
      - $ref: "../swagger.yaml#/parameters/page"
      - $ref: "../swagger.yaml#/parameters/per_page"
      - $ref: "../swagger.yaml#/parameters/q_param"
      - $ref: "../swagger.yaml#/parameters/q_body"
      - name: x-koha-embed
        in: header
        required: false
        description: Embed list sent as a request header
        type: array
        items:
          type: string
          enum:
            - basket_group
            - creator
            - days_late
        collectionFormat: csv
    produces:
      - application/json
    responses:
      "200":
        description: A list of baskets
        schema:
          type: array
          items:
            $ref: "../swagger.yaml#/definitions/basket"
      "400":
        description: |
          Bad request. Possible `error_code` attribute values:

            * `invalid_query`
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      "403":
        description: Access forbidden
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      "500":
        description: |
          Internal server error. Possible `error_code` attribute values:

          * `internal_server_error`
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      "503":
        description: Under maintenance
        schema:
          $ref: "../swagger.yaml#/definitions/error"
    x-koha-authorization:
      permissions:
        acquisition: order_manage
  post:
    x-mojo-to: Acquisitions::Baskets#add
    operationId: addBasket
    tags:
      - baskets
    summary: Add basket
    consumes:
      - application/json
    produces:
      - application/json
    parameters:
      - name: body
        in: body
        description: A basket
        required: true
        schema:
          $ref: "../swagger.yaml#/definitions/basket"
    responses:
      "201":
        description: A successfully created basket
        schema:
          items:
            $ref: "../swagger.yaml#/definitions/basket"
      "400":
        description: Bad request
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      "401":
        description: Authentication required
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      "403":
        description: Access forbidden
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      "404":
        description: Resource not found
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      "409":
        description: Conflict in creating resource
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      "500":
        description: |
          Internal server error. Possible `error_code` attribute values:

          * `internal_server_error`
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      "503":
        description: Under maintenance
        schema:
          $ref: "../swagger.yaml#/definitions/error"
    x-koha-authorization:
      permissions:
        acquisition:
          - order_manage
/acquisitions/baskets/managers:
  get:
    x-mojo-to: Acquisitions::Baskets#list_managers
    operationId: listBasketsManagers
    description: This resource returns a list of patron allowed to be a manager for baskets
    summary: List possible managers for baskets
    tags:
      - baskets
    parameters:
      - $ref: "../swagger.yaml#/parameters/match"
      - $ref: "../swagger.yaml#/parameters/order_by"
      - $ref: "../swagger.yaml#/parameters/page"
      - $ref: "../swagger.yaml#/parameters/per_page"
      - $ref: "../swagger.yaml#/parameters/q_param"
      - $ref: "../swagger.yaml#/parameters/q_body"
      - name: x-koha-embed
        in: header
        required: false
        description: Embed list sent as a request header
        type: array
        items:
          type: string
          enum:
            - extended_attributes
            - library
        collectionFormat: csv
    produces:
      - application/json
    responses:
      "200":
        description: A list of orders' managers
        schema:
          type: array
          items:
            $ref: "../swagger.yaml#/definitions/patron"
      "400":
        description: |
          Bad request. Possible `error_code` attribute values:

            * `invalid_query`
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      "403":
        description: Access forbidden
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      "500":
        description: |
          Internal server error. Possible `error_code` attribute values:

          * `internal_server_error`
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      "503":
        description: Under maintenance
        schema:
          $ref: "../swagger.yaml#/definitions/error"
    x-koha-authorization:
      permissions:
        acquisition: order_manage
