Koha/api/v1/swagger/paths/bookings.yaml
Martin Renvoize dadabbd924
Bug 36120: Add pickup_library support to bookings API
Sponsored-by: Cuyahoga County Public Library
Signed-off-by: Lisette Scheer <lisette.scheer@bywatersolutions.com>
Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-05-03 16:02:46 +02:00

239 lines
6.4 KiB
YAML

---
/bookings:
get:
x-mojo-to: Bookings#list
operationId: listBookings
parameters:
- description: Case insensative search on booking biblio_id
in: query
name: biblio_id
required: false
type: string
- description: Case insensative search on booking item_id
in: query
name: item_id
required: false
type: string
- description: Case insensative search on booking patron_id
in: query
name: patron_id
required: false
type: string
- description: Case Insensative search on booking start_date
in: query
name: start_date
required: false
type: string
- description: Case Insensative search on booking end_date
in: query
name: end_date
required: false
type: string
- $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:
- biblio
- item
- patron
- pickup_library
collectionFormat: csv
produces:
- application/json
responses:
200:
description: A list of bookings
schema:
items:
$ref: ../swagger.yaml#/definitions/booking
type: array
403:
description: Access forbidden
schema:
$ref: ../swagger.yaml#/definitions/error
500:
description: Internal error
schema:
$ref: ../swagger.yaml#/definitions/error
503:
description: Under maintenance
schema:
$ref: ../swagger.yaml#/definitions/error
summary: List bookings
tags:
- bookings
x-koha-authorization:
permissions:
catalogue: 1
post:
operationId: addBooking
parameters:
- description: A JSON object containing informations about the new booking
in: body
name: body
required: true
schema:
$ref: ../swagger.yaml#/definitions/booking
produces:
- application/json
responses:
201:
description: Booking added
schema:
$ref: ../swagger.yaml#/definitions/booking
400:
description: Client error
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
409:
description: Conflict
schema:
$ref: ../swagger.yaml#/definitions/error
500:
description: Internal error
schema:
$ref: ../swagger.yaml#/definitions/error
503:
description: Under maintenance
schema:
$ref: ../swagger.yaml#/definitions/error
summary: Add booking
tags:
- bookings
x-koha-authorization:
permissions:
circulate: manage_bookings
x-mojo-to: Bookings#add
"/bookings/{booking_id}":
delete:
operationId: deleteBooking
parameters:
- $ref: "../swagger.yaml#/parameters/booking_id_pp"
produces:
- application/json
responses:
204:
description: Booking deleted
401:
description: Authentication required
schema:
$ref: ../swagger.yaml#/definitions/error
403:
description: Access forbidden
schema:
$ref: ../swagger.yaml#/definitions/error
404:
description: Booking not found
schema:
$ref: ../swagger.yaml#/definitions/error
500:
description: Internal error
schema:
$ref: ../swagger.yaml#/definitions/error
503:
description: Under maintenance
schema:
$ref: ../swagger.yaml#/definitions/error
summary: Delete booking
tags:
- bookings
x-koha-authorization:
permissions:
circulate: manage_bookings
x-mojo-to: Bookings#delete
get:
operationId: getBooking
parameters:
- $ref: "../swagger.yaml#/parameters/booking_id_pp"
produces:
- application/json
responses:
200:
description: A booking
schema:
$ref: ../swagger.yaml#/definitions/booking
404:
description: Booking not found
schema:
$ref: ../swagger.yaml#/definitions/error
500:
description: Internal error
schema:
$ref: ../swagger.yaml#/definitions/error
503:
description: Under maintenance
schema:
$ref: ../swagger.yaml#/definitions/error
summary: Get booking
tags:
- bookings
x-koha-authorization:
permissions:
catalogue: 1
x-mojo-to: Bookings#get
put:
operationId: updateBooking
parameters:
- $ref: "../swagger.yaml#/parameters/booking_id_pp"
- description: A booking object
in: body
name: body
required: true
schema:
$ref: ../swagger.yaml#/definitions/booking
produces:
- application/json
responses:
200:
description: A booking
schema:
$ref: ../swagger.yaml#/definitions/booking
400:
description: Client error
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: Booking not found
schema:
$ref: ../swagger.yaml#/definitions/error
500:
description: Internal error
schema:
$ref: ../swagger.yaml#/definitions/error
503:
description: Under maintenance
schema:
$ref: ../swagger.yaml#/definitions/error
summary: Update booking
tags:
- bookings
x-koha-authorization:
permissions:
circulate: manage_bookings
x-mojo-to: Bookings#update