Lines 152-157
Link Here
|
152 |
} |
152 |
} |
153 |
} |
153 |
} |
154 |
} |
154 |
} |
|
|
155 |
}, |
156 |
"/borrowers/{borrowernumber}/reserves": { |
157 |
"get": { |
158 |
"x-mojo-controller": "Koha::REST::V1::Borrowers::Reserves", |
159 |
"operationId": "listBorrowerReserves", |
160 |
"tags": ["borrowers", "reserves"], |
161 |
"parameters": [ |
162 |
{ "$ref": "#/parameters/borrowernumberPathParam" } |
163 |
], |
164 |
"produces": ["application/json"], |
165 |
"responses": { |
166 |
"200": { |
167 |
"description": "A list of reserves", |
168 |
"schema": { "$ref": "#/definitions/reserves" } |
169 |
}, |
170 |
"404": { |
171 |
"description": "Borrower not found", |
172 |
"schema": { "$ref": "#/definitions/error" } |
173 |
} |
174 |
} |
175 |
}, |
176 |
"post": { |
177 |
"x-mojo-controller": "Koha::REST::V1::Borrowers::Reserves", |
178 |
"operationId": "addBorrowerReserve", |
179 |
"tags": ["borrowers", "reserves"], |
180 |
"parameters": [ |
181 |
{ "$ref": "#/parameters/borrowernumberPathParam" }, |
182 |
{ |
183 |
"name": "body", |
184 |
"in": "body", |
185 |
"description": "A JSON object containing informations about the new reserve", |
186 |
"required": true, |
187 |
"schema": { "$ref": "#/definitions/newBorrowerReserveBody" } |
188 |
} |
189 |
], |
190 |
"consumes": ["application/json"], |
191 |
"produces": ["application/json"], |
192 |
"responses": { |
193 |
"201": { |
194 |
"description": "Created reserve", |
195 |
"schema": { "$ref": "#/definitions/reserve" } |
196 |
}, |
197 |
"400": { |
198 |
"description": "Missing or wrong parameters", |
199 |
"schema": { "$ref": "#/definitions/error" } |
200 |
}, |
201 |
"403": { |
202 |
"description": "Reserve not allowed", |
203 |
"schema": { "$ref": "#/definitions/error" } |
204 |
}, |
205 |
"404": { |
206 |
"description": "Borrower not found", |
207 |
"schema": { "$ref": "#/definitions/error" } |
208 |
}, |
209 |
"500": { |
210 |
"description": "Internal error", |
211 |
"schema": { "$ref": "#/definitions/error" } |
212 |
} |
213 |
} |
214 |
} |
215 |
}, |
216 |
"/reserves/{reserve_id}": { |
217 |
"put": { |
218 |
"x-mojo-controller": "Koha::REST::V1::Reserves", |
219 |
"operationId": "editReserve", |
220 |
"tags": ["reserves"], |
221 |
"parameters": [ |
222 |
{ "$ref": "#/parameters/reserveIdPathParam" }, |
223 |
{ |
224 |
"name": "body", |
225 |
"in": "body", |
226 |
"description": "A JSON object containing fields to modify", |
227 |
"required": true, |
228 |
"schema": { "$ref": "#/definitions/editReserveBody" } |
229 |
} |
230 |
], |
231 |
"consumes": ["application/json"], |
232 |
"produces": ["application/json"], |
233 |
"responses": { |
234 |
"200": { |
235 |
"description": "Updated reserve", |
236 |
"schema": { "$ref": "#/definitions/reserve" } |
237 |
}, |
238 |
"400": { |
239 |
"description": "Missing or wrong parameters", |
240 |
"schema": { "$ref": "#/definitions/error" } |
241 |
}, |
242 |
"404": { |
243 |
"description": "Reserve not found", |
244 |
"schema": { "$ref": "#/definitions/error" } |
245 |
} |
246 |
} |
247 |
}, |
248 |
"delete": { |
249 |
"x-mojo-controller": "Koha::REST::V1::Reserves", |
250 |
"operationId": "deleteReserve", |
251 |
"tags": ["reserves"], |
252 |
"parameters": [ |
253 |
{ "$ref": "#/parameters/reserveIdPathParam" } |
254 |
], |
255 |
"produces": ["application/json"], |
256 |
"responses": { |
257 |
"204": { |
258 |
"description": "No content", |
259 |
"schema": { |
260 |
"type": "null" |
261 |
} |
262 |
}, |
263 |
"404": { |
264 |
"description": "Reserve not found", |
265 |
"schema": { "$ref": "#/definitions/error" } |
266 |
} |
267 |
} |
268 |
} |
155 |
} |
269 |
} |
156 |
}, |
270 |
}, |
157 |
"definitions": { |
271 |
"definitions": { |
Lines 222-227
Link Here
|
222 |
} |
336 |
} |
223 |
} |
337 |
} |
224 |
}, |
338 |
}, |
|
|
339 |
"reserves": { |
340 |
"type": "array", |
341 |
"items": { "$ref": "#/definitions/reserve" } |
342 |
}, |
343 |
"reserve": { |
344 |
"type": "object", |
345 |
"properties": { |
346 |
"reserve_id": { |
347 |
"description": "Internal reserve identifier" |
348 |
}, |
349 |
"borrowernumber": { "$ref" : "#/definitions/borrowernumber" }, |
350 |
"reservedate": { |
351 |
"description": "the date the reserve was placed" |
352 |
}, |
353 |
"biblionumber": { "$ref": "#/definitions/biblionumber" }, |
354 |
"constrainttype": { |
355 |
"description": "type of constraint" |
356 |
}, |
357 |
"branchcode": { "$ref": "#/definitions/branchcode" }, |
358 |
"notificationdate": { |
359 |
"description": "currently unused" |
360 |
}, |
361 |
"reminderdate": { |
362 |
"description": "currently unused" |
363 |
}, |
364 |
"cancellationdate": { |
365 |
"description": "the date the reserve was cancelled" |
366 |
}, |
367 |
"reservenotes": { |
368 |
"description": "notes related to this reserve" |
369 |
}, |
370 |
"priority": { |
371 |
"description": "where in the queue the patron sits" |
372 |
}, |
373 |
"found": { |
374 |
"description": "a one letter code defining what the status of the reserve is after it has been confirmed" |
375 |
}, |
376 |
"timestamp": { |
377 |
"description": "date and time the reserve was last updated" |
378 |
}, |
379 |
"itemnumber": { "$ref": "#/definitions/itemnumber" }, |
380 |
"waitingdate": { |
381 |
"description": "the date the item was marked as waiting for the patron at the library" |
382 |
}, |
383 |
"expirationdate": { |
384 |
"description": "the date the reserve expires" |
385 |
}, |
386 |
"lowestPriority": { |
387 |
"description": "" |
388 |
}, |
389 |
"suspend": { |
390 |
"description": "" |
391 |
}, |
392 |
"suspend_until": { |
393 |
"description": "" |
394 |
} |
395 |
} |
396 |
}, |
397 |
"newBorrowerReserveBody": { |
398 |
"type": "object", |
399 |
"properties": { |
400 |
"biblionumber": { |
401 |
"description": "Biblio internal identifier", |
402 |
"type": "integer" |
403 |
}, |
404 |
"itemnumber": { |
405 |
"description": "Item internal identifier", |
406 |
"type": "integer" |
407 |
}, |
408 |
"branchcode": { |
409 |
"description": "Pickup location", |
410 |
"type": "string", |
411 |
"required": true |
412 |
}, |
413 |
"expirationdate": { |
414 |
"description": "Reserve end date", |
415 |
"type": "string", |
416 |
"format": "date" |
417 |
} |
418 |
} |
419 |
}, |
420 |
"editReserveBody": { |
421 |
"type": "object", |
422 |
"properties": { |
423 |
"priority": { |
424 |
"description": "Position in waiting queue", |
425 |
"type": "integer", |
426 |
"minimum": 1 |
427 |
}, |
428 |
"branchcode": { |
429 |
"description": "Pickup location", |
430 |
"type": "string" |
431 |
}, |
432 |
"suspend_until": { |
433 |
"description": "Suspend until", |
434 |
"type": "string", |
435 |
"format": "date" |
436 |
} |
437 |
} |
438 |
}, |
439 |
"biblionumber": { |
440 |
"description": "Biblio internal identifier" |
441 |
}, |
225 |
"borrowernumber": { |
442 |
"borrowernumber": { |
226 |
"description": "Borrower internal identifier" |
443 |
"description": "Borrower internal identifier" |
227 |
}, |
444 |
}, |
Lines 246-252
Link Here
|
246 |
"name": "borrowernumber", |
463 |
"name": "borrowernumber", |
247 |
"in": "path", |
464 |
"in": "path", |
248 |
"description": "Internal borrower identifier", |
465 |
"description": "Internal borrower identifier", |
249 |
"required": "true", |
466 |
"required": true, |
|
|
467 |
"type": "integer" |
468 |
}, |
469 |
"reserveIdPathParam": { |
470 |
"name": "reserve_id", |
471 |
"in": "path", |
472 |
"description": "Internal reserve identifier", |
473 |
"required": true, |
250 |
"type": "integer" |
474 |
"type": "integer" |
251 |
}, |
475 |
}, |
252 |
"itemnumberPathParam": { |
476 |
"itemnumberPathParam": { |