[Bug 42998] New: Allow a requested due date when renewing a checkout via the REST API
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42998 Bug ID: 42998 Summary: Allow a requested due date when renewing a checkout via the REST API Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: tomascohen@gmail.com Target Milestone: --- Depends on bug 42997 (booking/checkout due date synchronisation). This patch extends the checkout renewal endpoints so API consumers can renew a checkout through to a specific date: - an optional request body may carry a due_date (RFC3339); it is used in place of the due date calculated from the circulation rules and is validated against any bookings for the item via CanBookBeRenewed. When the checkout is linked to a booking, AddRenewal keeps the booking end date in sync (bug 42997) - a new renewal_limit value is accepted in the x-koha-override header, skipping renewal count limits when AllowRenewalLimitOverride is enabled - intended for staff explicitly authorising an extension of a booked loan - the 403 error response now carries the CanBookBeRenewed error as a machine-readable error_code (e.g. 'booked', 'too_many') The requested due date is a body attribute rather than a query parameter or override: the POST creates a renewal resource and the date is data about that renewal. The existing 'seen' query parameter predates the current guidelines and has been left untouched. Both /checkouts/{checkout_id}/renewal and the newer /checkouts/{checkout_id}/renewals route to the same controller, so the body is accepted and documented on both. Test plan: 1. yarn api:bundle && restart_all 2. Run t/db_dependent/api/v1/checkouts.t -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42998 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |42997 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42997 [Bug 42997] Keep booking end dates in sync with checkout due dates at issue and renewal -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42998 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |42790 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42790 [Bug 42790] Clarify and unify bookings actions to 'Edit, Cancel, Checkout, Extend' shown appropriate per status and permission -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42998 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Sponsorship status|--- |Unsponsored Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42998 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 201548 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201548&action=edit Bug 42998: Allow a requested due date on the checkout renewal endpoints This patch extends the checkout renewal endpoints so API consumers can renew a checkout through to a specific date, providing the server-side pathway for extending issued bookings through their linked checkout (bug 42997, bug 42790): * an optional request body may carry a `due_date` (RFC3339); it is passed through to CanBookBeRenewed - so it is validated against bookings for the item - and then to AddRenewal, which keeps any linked booking's end_date in sync * a new `renewal_limit` value is accepted in the x-koha-override header, skipping renewal count limits when AllowRenewalLimitOverride is enabled - staff extending a booked loan should not be blocked by the renewal count * the 403 error response now carries the CanBookBeRenewed error as a machine-readable `error_code` (e.g. 'booked', 'too_many') Both /checkouts/{checkout_id}/renewal and the newer /checkouts/{checkout_id}/renewals route to the same controller, so the body and override are accepted and documented on both. The requested due date is a body attribute rather than a query parameter or override: the POST creates a renewal resource and the date is data about that renewal. The existing 'seen' query parameter predates the current guidelines and has been left untouched. Test plan: 1) yarn api:bundle && restart_all 2) Run t/db_dependent/api/v1/checkouts.t and confirm the new 'renew() with requested due_date and bookings' subtest passes -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org