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>
This commit is contained in:
Martin Renvoize 2024-03-07 17:12:51 +00:00 committed by Katrin Fischer
parent b3fa2506cd
commit dadabbd924
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834
4 changed files with 28 additions and 3 deletions

View file

@ -58,6 +58,19 @@ sub patron {
return Koha::Patron->_new_from_dbic($patron_rs);
}
=head3 pickup_library
Returns the related Koha::Library object for this booking
=cut
sub pickup_library {
my ($self) = @_;
my $pickup_library_rs = $self->_result->pickup_library;
return Koha::Library->_new_from_dbic($pickup_library_rs);
}
=head3 item
Returns the related Koha::Item object for this Booking

View file

@ -32,6 +32,14 @@ properties:
type:
- object
- "null"
pickup_library_id:
description: Internal pickup_library identifier
type: string
pickup_library:
description: Embedable pickup_library representation
type:
- object
- "null"
start_date:
description: Start date and time of this booking
format: date-time
@ -40,6 +48,7 @@ required:
- biblio_id
- item_id
- patron_id
- pickup_library_id
- start_date
- end_date
type: object

View file

@ -300,6 +300,7 @@
enum:
- item
- patron
- pickup_library
collectionFormat: csv
consumes:
- application/json
@ -373,7 +374,8 @@
collectionFormat: csv
- name: checked_in
in: query
description: By default, current checkouts are returned, when this is true then
description:
By default, current checkouts are returned, when this is true then
checked in checkouts are returned as result.
type: boolean
produces:
@ -812,7 +814,7 @@
- integer
- "null"
required:
- rating
- rating
additionalProperties: false
produces:
- application/json

View file

@ -46,6 +46,7 @@
- biblio
- item
- patron
- pickup_library
collectionFormat: csv
produces:
- application/json
@ -121,7 +122,7 @@
permissions:
circulate: manage_bookings
x-mojo-to: Bookings#add
'/bookings/{booking_id}':
"/bookings/{booking_id}":
delete:
operationId: deleteBooking
parameters: