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