@@ -, +, @@ --- Koha/Booking.pm | 13 +++++++++++++ api/v1/swagger/definitions/booking.yaml | 8 ++++++++ api/v1/swagger/paths/bookings.yaml | 3 ++- 3 files changed, 23 insertions(+), 1 deletion(-) --- a/Koha/Booking.pm +++ a/Koha/Booking.pm @@ -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 --- a/api/v1/swagger/definitions/booking.yaml +++ a/api/v1/swagger/definitions/booking.yaml @@ -33,6 +33,14 @@ properties: type: - object - "null" + pickup_library_id: + description: Internal pickup_library identifier + type: integer + pickup_library: + description: Embedable pickup_library representation + type: + - object + - "null" start_date: description: Start date and time of this booking format: date-time --- a/api/v1/swagger/paths/bookings.yaml +++ a/api/v1/swagger/paths/bookings.yaml @@ -46,6 +46,7 @@ - biblio - item - patron + - pickup_library collectionFormat: csv produces: - application/json @@ -117,7 +118,7 @@ permissions: circulate: manage_bookings x-mojo-to: Bookings#add -'/bookings/{booking_id}': +"/bookings/{booking_id}": delete: operationId: deleteBooking parameters: --