Bug 18407 - REST API: Include renewability information on checkouts
Summary: REST API: Include renewability information on checkouts
Status: ASSIGNED
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Josef Moravec
QA Contact:
URL:
Keywords:
Depends on: 17003 17005 18137
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-10 09:28 UTC by Lari Taskula
Modified: 2019-04-05 07:39 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 18407: REST API: Add expanded checkout information (13.65 KB, patch)
2017-04-10 09:31 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 18407: (follow-up) Add renewability error information (3.39 KB, patch)
2017-04-10 11:05 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 18407: (follow-up) Add test for librarian access (2.08 KB, patch)
2017-04-10 11:05 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 18407: (squashable) Fix rollback issue (1.55 KB, patch)
2017-07-12 17:52 UTC, Lari Taskula
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lari Taskula 2017-04-10 09:28:19 UTC
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.
Comment 1 Lari Taskula 2017-04-10 09:31:42 UTC
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
Comment 2 Lari Taskula 2017-04-10 09:34:02 UTC
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.
Comment 3 Lari Taskula 2017-04-10 11:05:17 UTC
Created attachment 61992 [details] [review]
Bug 18407: (follow-up) Add renewability error information
Comment 4 Lari Taskula 2017-04-10 11:05:29 UTC
Created attachment 61993 [details] [review]
Bug 18407: (follow-up) Add test for librarian access
Comment 5 Lari Taskula 2017-07-12 17:52:55 UTC
Created attachment 65009 [details] [review]
Bug 18407: (squashable) Fix rollback issue
Comment 6 Ere Maijala 2019-04-04 11:01:08 UTC
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.