Koha/api/v1/swagger/paths
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
..
acquisitions_funds.json
acquisitions_orders.json Bug 20212: Add more embeddable objects to orders 2021-01-28 16:44:11 +01:00
acquisitions_vendors.json Bug 25048: Make successful resource deletion return 204 2020-04-29 16:24:43 +01:00
advancededitormacros.json Bug 25502: Adapt Advanced macros routes to current guidelines 2020-05-19 15:21:16 +01:00
biblios.json Bug 24908: Add text-formatted MARC support in /biblios/{biblio_id} 2020-04-29 17:13:36 +01:00
checkouts.json Bug 24083: Add support for unseen_renewals 2020-11-11 16:09:58 +01:00
circulation-rules.json
cities.json Bug 25279: Add general query parameters to the /cities route 2020-05-12 11:39:36 +01:00
clubs.json Bug 23820: Add checkout to default to patron's home branch on club hold 2020-07-20 17:45:30 +02:00
config_smtp_servers.json Bug 22343: API routes for SMTP servers CRUD 2020-10-02 10:54:40 +02:00
holds.json Bug 27015: Make pickup locations searchable 2021-01-04 16:33:15 +01:00
ill_backends.json
illrequests.json Bug 25944: Schema fix for illrequests route 2020-07-16 15:32:51 +01:00
import_batch_profiles.json Bug 23019: (follow-up) Fix test permissions and API definition bugs 2020-11-11 15:55:49 +01:00
items.json
libraries.json Bug 26595: Embed the whole smtp_server object 2020-10-14 15:53:38 +02:00
oauth.json
patrons.json Bug 25048: Make successful resource deletion return 204 2020-04-29 16:24:43 +01:00
patrons_account.json
patrons_password.json
public_patrons.json
return_claims.json
rotas.json