It would be useful to have renewability information directly in the /checkouts endpoint to avoid making additional requests. However, this could be optional. Create /api/v1/checkouts/expanded endpoint to include additional data on checkouts.
Created attachment 61991 [details] [review] Bug 18407: REST API: Add expanded checkout information GET /api/v1/checkouts/expanded?borrowernumber=1337 This endpoint includes basic checkout information as well as additionally information on renewability. To test: 1. prove t/db_dependent/api/v1/checkoutsexpanded.t
This patch does not yet apply and is dependent on Mojolicious::Plugin::OpenAPI migration and /api/v1/checkouts endpoint (Bug 13895). I just dumped the patch here if anyone is interested in similar feature. Rebase when those move on.
Created attachment 61992 [details] [review] Bug 18407: (follow-up) Add renewability error information
Created attachment 61993 [details] [review] Bug 18407: (follow-up) Add test for librarian access
Created attachment 65009 [details] [review] Bug 18407: (squashable) Fix rollback issue
I've optimized the retrieval a bit in our local custom version: https://github.com/KohaSuomi/Koha/blob/master/Koha/REST/V1/Checkout.pm#L247, so I think that's worth checking out too.