Bug 30055: (follow-up) Add missing embeds
[koha.git] / api / v1 / swagger / paths / suggestions.yaml
1 ---
2 /suggestions:
3   get:
4     x-mojo-to: Suggestions#list
5     operationId: listSuggestions
6     description: This resource returns a list of purchase suggestions
7     summary: List purchase suggestions
8     tags:
9       - suggestions
10     parameters:
11       - $ref: "../swagger.yaml#/parameters/match"
12       - $ref: "../swagger.yaml#/parameters/order_by"
13       - $ref: "../swagger.yaml#/parameters/page"
14       - $ref: "../swagger.yaml#/parameters/per_page"
15       - $ref: "../swagger.yaml#/parameters/q_param"
16       - $ref: "../swagger.yaml#/parameters/q_body"
17       - $ref: "../swagger.yaml#/parameters/q_header"
18     produces:
19       - application/json
20     responses:
21       "200":
22         description: A list of suggestions
23         schema:
24           type: array
25           items:
26             $ref: "../swagger.yaml#/definitions/suggestion"
27       "403":
28         description: Access forbidden
29         schema:
30           $ref: "../swagger.yaml#/definitions/error"
31       "500":
32         description: |
33           Internal server error. Possible `error_code` attribute values:
34
35           * `internal_server_error`
36         schema:
37           $ref: "../swagger.yaml#/definitions/error"
38       "503":
39         description: Under maintenance
40         schema:
41           $ref: "../swagger.yaml#/definitions/error"
42     x-koha-authorization:
43       permissions:
44         suggestions: suggestions_manage
45   post:
46     x-mojo-to: Suggestions#add
47     operationId: addSuggestions
48     description: This resource accepts a new purchase suggestion and creates it
49     summary: Add a purchase suggestion
50     tags:
51       - suggestions
52     parameters:
53       - name: body
54         in: body
55         description: A JSON object containing informations about the new suggestion
56         required: true
57         schema:
58           $ref: "../swagger.yaml#/definitions/suggestion"
59     produces:
60       - application/json
61     responses:
62       "201":
63         description: Suggestion added
64         schema:
65           $ref: "../swagger.yaml#/definitions/suggestion"
66       "400":
67         description: Bad request
68         schema:
69           $ref: "../swagger.yaml#/definitions/error"
70       "403":
71         description: Access forbidden
72         schema:
73           $ref: "../swagger.yaml#/definitions/error"
74       "500":
75         description: |
76           Internal server error. Possible `error_code` attribute values:
77
78           * `internal_server_error`
79         schema:
80           $ref: "../swagger.yaml#/definitions/error"
81       "503":
82         description: Under maintenance
83         schema:
84           $ref: "../swagger.yaml#/definitions/error"
85     x-koha-authorization:
86       permissions:
87         suggestions: suggestions_manage
88 "/suggestions/{suggestion_id}":
89   get:
90     x-mojo-to: Suggestions#get
91     operationId: getSuggestion
92     description: This resource gives access to a specific purchase suggestion
93     summary: Get purchase suggestion
94     tags:
95       - suggestions
96     parameters:
97       - $ref: "../swagger.yaml#/parameters/suggestion_id_pp"
98     produces:
99       - application/json
100     responses:
101       "200":
102         description: A suggestion
103         schema:
104           $ref: "../swagger.yaml#/definitions/suggestion"
105       "403":
106         description: Access forbidden
107         schema:
108           $ref: "../swagger.yaml#/definitions/error"
109       "404":
110         description: Suggestion not found
111         schema:
112           $ref: "../swagger.yaml#/definitions/error"
113       "500":
114         description: |
115           Internal server error. Possible `error_code` attribute values:
116
117           * `internal_server_error`
118         schema:
119           $ref: "../swagger.yaml#/definitions/error"
120       "503":
121         description: Under maintenance
122         schema:
123           $ref: "../swagger.yaml#/definitions/error"
124     x-koha-authorization:
125       permissions:
126         suggestions: suggestions_manage
127   put:
128     x-mojo-to: Suggestions#update
129     operationId: updateSuggestion
130     description: This resource allows updating an existing purchase suggestion
131     summary: Update purchase suggestion
132     tags:
133       - suggestions
134     parameters:
135       - $ref: "../swagger.yaml#/parameters/suggestion_id_pp"
136       - name: body
137         in: body
138         description: A JSON object containing informations about the new hold
139         required: true
140         schema:
141           $ref: "../swagger.yaml#/definitions/suggestion"
142     produces:
143       - application/json
144     responses:
145       "200":
146         description: A suggestion
147         schema:
148           $ref: "../swagger.yaml#/definitions/suggestion"
149       "400":
150         description: Bad request
151         schema:
152           $ref: "../swagger.yaml#/definitions/error"
153       "403":
154         description: Access forbidden
155         schema:
156           $ref: "../swagger.yaml#/definitions/error"
157       "404":
158         description: Suggestion not found
159         schema:
160           $ref: "../swagger.yaml#/definitions/error"
161       "500":
162         description: |
163           Internal server error. Possible `error_code` attribute values:
164
165           * `internal_server_error`
166         schema:
167           $ref: "../swagger.yaml#/definitions/error"
168       "503":
169         description: Under maintenance
170         schema:
171           $ref: "../swagger.yaml#/definitions/error"
172     x-koha-authorization:
173       permissions:
174         suggestions: suggestions_manage
175   delete:
176     x-mojo-to: Suggestions#delete
177     operationId: deleteSuggestion
178     description: This resource deletes an existing purchase suggestion
179     summary: Delete purchase suggestion
180     tags:
181       - suggestions
182     parameters:
183       - $ref: "../swagger.yaml#/parameters/suggestion_id_pp"
184     produces:
185       - application/json
186     responses:
187       "204":
188         description: Suggestion deleted
189         schema:
190           type: string
191       "401":
192         description: Authentication required
193         schema:
194           $ref: "../swagger.yaml#/definitions/error"
195       "403":
196         description: Access forbidden
197         schema:
198           $ref: "../swagger.yaml#/definitions/error"
199       "404":
200         description: Suggestion not found
201         schema:
202           $ref: "../swagger.yaml#/definitions/error"
203       "500":
204         description: |
205           Internal server error. Possible `error_code` attribute values:
206
207           * `internal_server_error`
208         schema:
209           $ref: "../swagger.yaml#/definitions/error"
210       "503":
211         description: Under maintenance
212         schema:
213           $ref: "../swagger.yaml#/definitions/error"
214     x-koha-authorization:
215       permissions:
216         suggestions: suggestions_manage
217 /suggestions/managers:
218   get:
219     x-mojo-to: Suggestions#list_managers
220     operationId: listSuggestionsManagers
221     description: This resource returns a list of patron allowed to be a manager for suggestions
222     summary: List possibe managers for suggestions
223     tags:
224       - suggestions
225     parameters:
226       - $ref: ../parameters.yaml#/match
227       - $ref: ../parameters.yaml#/order_by
228       - $ref: ../parameters.yaml#/page
229       - $ref: ../parameters.yaml#/per_page
230       - $ref: ../parameters.yaml#/q_param
231       - $ref: ../parameters.yaml#/q_body
232       - $ref: ../parameters.yaml#/q_header
233     produces:
234       - application/json
235     responses:
236       "200":
237         description: A list of suggestions' managers
238         schema:
239           type: array
240           items:
241             $ref: ../definitions.yaml#/patron
242       "403":
243         description: Access forbidden
244         schema:
245           $ref: ../definitions.yaml#/error
246       "500":
247         description: |
248           Internal server error. Possible `error_code` attribute values:
249
250           * `internal_server_error`
251         schema:
252           $ref: ../definitions.yaml#/error
253       "503":
254         description: Under maintenance
255         schema:
256           $ref: ../definitions.yaml#/error
257     x-koha-authorization:
258       permissions:
259         suggestions: suggestions_manage
260     x-koha-embed:
261       - extended_attributes