Koha-clms/api/v1/swagger/definitions
Tomas Cohen Arazi ade441def4 Bug 20212: Add more embeddable objects to orders
This patch adds options to embed more related objects based on the needs
by parcel.tt.

For filtering by biblioitems fields (ISBN and EAN) I had to make the
'list' method a modified version of the objects->search helper. I
thought of doing it in a more generic way but I didn't find any other
use cases and it would certainly make an already complex piece of code
even more complex.

So this is quite similar, but at some steps the biblio.<biblioitem
field> gets translated into the proper relation names, and the same
happens for prefetching.

A new parameter is also added: only_active. It makes the controller use
Koha::Acquisition::Orders->filter_by_active, avoiding the need to build
complex queries in the UI.

The same handling is done when the order_id parameter is passed (outside
the q= parameters). In this case using Koha::Acquisition::Orders->filter_by_id_including_transfers

This is all respecting the C4::Acquisitions::SearchOrders behaviour.

TL;DR:

This patch adapts the code from the list() sub so it manipulates the
query parameters and the embed header so:
- the biblioitem relationship is prefetch
- any queries on biblio.isbn and biblio.ean are correctly translated into search on the
  biblioitems table.
- Adds an only_active parameter to the /acquisitions/orders route to
  easily request only the active orders.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-01-28 16:44:11 +01:00
..
account_line.json Bug 26271: Add null to the list of accepted account_line data types 2020-09-03 14:18:23 +02:00
advancededitormacro.json Bug 17268: Advanced cataloging editor macros - add endpoint 2020-05-04 08:25:21 +01:00
allows_renewal.json Bug 17003: (follow-up) Update definitions according to voted RFC 2019-07-01 16:10:15 +01:00
basket.json Bug 18731: OpenAPI definitions 2020-01-09 16:25:57 +00:00
checkout.json Bug 24083: Add support for unseen_renewals 2020-11-11 16:09:58 +01:00
checkouts.json Bug 13895: Add API routes for checkouts retrieval and renewal 2019-03-28 19:38:41 +00:00
circ-rule-kind.json Bug 18936: (follow-up) Add foreign key and scope enhancement to circ rules 2020-02-04 09:56:24 +00:00
city.json Bug 20004: Adapt /v1/cities to new naming guidelines 2018-02-16 17:53:42 -03:00
club_hold.json Bug 19618: Add api endpoint for club holds 2019-10-01 08:05:58 +01:00
club_hold_patron_hold.json Bug 19618: Add api endpoint for club holds 2019-10-01 08:05:58 +01:00
club_hold_patron_holds.json Bug 19618: Add api endpoint for club holds 2019-10-01 08:05:58 +01:00
club_holds.json Bug 19618: Add api endpoint for club holds 2019-10-01 08:05:58 +01:00
error.json Bug 16699: Move Swagger-related files to api/v1/swagger 2016-08-26 12:08:52 +00:00
fund.json Bug 23843: Add mapping to Koha::Acquisition::Fund 2019-10-23 18:03:24 +01:00
hold.json Bug 22789: Add non priority feature to C4 classes and staff interface 2020-08-31 16:10:25 +02:00
holds.json Bug 16699: Move Swagger-related files to api/v1/swagger 2016-08-26 12:08:52 +00:00
ill_backend.json Bug 22615: Add /ill_backends endpoint 2020-03-05 13:03:32 +00:00
ill_backends.json Bug 22615: Add /ill_backends endpoint 2020-03-05 13:03:32 +00:00
import_batch_profile.json Bug 23019: (follow-up) Fix usability issues 2020-11-11 15:55:49 +01:00
import_batch_profiles.json Bug 23019: (follow-up) Fix usability issues 2020-11-11 15:55:49 +01:00
invoice.json Bug 18731: OpenAPI definitions 2020-01-09 16:25:57 +00:00
item.json Bug 19889: Add new attribute to the REST API definition 2020-09-01 12:22:06 +02:00
library.json Bug 22818: (follow-up) Respond to feedback 2020-11-11 08:35:10 +01:00
order.json Bug 20212: Add more embeddable objects to orders 2021-01-28 16:44:11 +01:00
patron.json Bug 26718: Rename "reading history" to "checkout history" 2020-11-04 12:59:33 +01:00
patron_account_credit.json Bug 24592: Reword LOST_RETURN to LOST_FOUND 2020-02-13 15:58:49 +00:00
patron_balance.json Bug 20942: Split debit and credit lines 2018-07-18 16:49:27 +00:00
return_claim.json Bug 14697: Add routes to handle return claims 2019-10-31 12:04:13 +00:00
smtp_server.json Bug 22343: API routes for SMTP servers CRUD 2020-10-02 10:54:40 +02:00
vendor.json Bug 18120: Update field descriptions 2017-09-29 17:13:13 -03:00