Tomas Cohen Arazi
8cc404b651
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
201 lines
5.5 KiB
YAML
201 lines
5.5 KiB
YAML
---
|
|
/suggestions:
|
|
get:
|
|
x-mojo-to: Suggestions#list
|
|
operationId: listSuggestions
|
|
description: This resource returns a list of purchase suggestions
|
|
summary: List purchase suggestions
|
|
tags:
|
|
- suggestions
|
|
parameters:
|
|
- $ref: ../parameters.json#/match
|
|
- $ref: ../parameters.json#/order_by
|
|
- $ref: ../parameters.json#/page
|
|
- $ref: ../parameters.json#/per_page
|
|
- $ref: ../parameters.json#/q_param
|
|
- $ref: ../parameters.json#/q_body
|
|
- $ref: ../parameters.json#/q_header
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: A list of suggestions
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: ../definitions.json#/suggestion
|
|
"403":
|
|
description: Access forbidden
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
"500":
|
|
description: Internal error
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
"503":
|
|
description: Under maintenance
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
x-koha-authorization:
|
|
permissions:
|
|
suggestions: suggestions_manage
|
|
post:
|
|
x-mojo-to: Suggestions#add
|
|
operationId: addSuggestions
|
|
description: This resource accepts a new purchase suggestion and creates it
|
|
summary: Add a purchase suggestion
|
|
tags:
|
|
- suggestions
|
|
parameters:
|
|
- name: body
|
|
in: body
|
|
description: A JSON object containing informations about the new suggestion
|
|
required: true
|
|
schema:
|
|
$ref: ../definitions.json#/suggestion
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Suggestion added
|
|
schema:
|
|
$ref: ../definitions.json#/suggestion
|
|
"400":
|
|
description: Bad request
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
"403":
|
|
description: Access forbidden
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
"500":
|
|
description: Internal error
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
"503":
|
|
description: Under maintenance
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
x-koha-authorization:
|
|
permissions:
|
|
suggestions: suggestions_manage
|
|
"/suggestions/{suggestion_id}":
|
|
get:
|
|
x-mojo-to: Suggestions#get
|
|
operationId: getSuggestion
|
|
description: This resource gives access to a specific purchase suggestion
|
|
summary: Get purchase suggestion
|
|
tags:
|
|
- suggestions
|
|
parameters:
|
|
- $ref: ../parameters.json#/suggestion_id_pp
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: A suggestion
|
|
schema:
|
|
$ref: ../definitions.json#/suggestion
|
|
"403":
|
|
description: Access forbidden
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
"404":
|
|
description: Suggestion not found
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
"500":
|
|
description: Internal error
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
"503":
|
|
description: Under maintenance
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
x-koha-authorization:
|
|
permissions:
|
|
suggestions: suggestions_manage
|
|
put:
|
|
x-mojo-to: Suggestions#update
|
|
operationId: updateSuggestion
|
|
description: This resource allows updating an existing purchase suggestion
|
|
summary: Update purchase suggestion
|
|
tags:
|
|
- suggestions
|
|
parameters:
|
|
- $ref: ../parameters.json#/suggestion_id_pp
|
|
- name: body
|
|
in: body
|
|
description: A JSON object containing informations about the new hold
|
|
required: true
|
|
schema:
|
|
$ref: ../definitions.json#/suggestion
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: A suggestion
|
|
schema:
|
|
$ref: ../definitions.json#/suggestion
|
|
"400":
|
|
description: Bad request
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
"403":
|
|
description: Access forbidden
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
"404":
|
|
description: Suggestion not found
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
"500":
|
|
description: Internal error
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
"503":
|
|
description: Under maintenance
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
x-koha-authorization:
|
|
permissions:
|
|
suggestions: suggestions_manage
|
|
delete:
|
|
x-mojo-to: Suggestions#delete
|
|
operationId: deleteSuggestion
|
|
description: This resource deletes an existing purchase suggestion
|
|
summary: Delete purchase suggestion
|
|
tags:
|
|
- suggestions
|
|
parameters:
|
|
- $ref: ../parameters.json#/suggestion_id_pp
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"204":
|
|
description: Suggestion deleted
|
|
schema:
|
|
type: string
|
|
"401":
|
|
description: Authentication required
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
"403":
|
|
description: Access forbidden
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
"404":
|
|
description: Suggestion not found
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
"500":
|
|
description: Internal error
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
"503":
|
|
description: Under maintenance
|
|
schema:
|
|
$ref: ../definitions.json#/error
|
|
x-koha-authorization:
|
|
permissions:
|
|
suggestions: suggestions_manage
|