https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42998
--- Comment #2 from Martin Renvoize (ashimema) <[email protected]> --- Created attachment 202371 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202371&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 Sponsored-by: OpenFifth <https://openfifth.co.uk/\> Sponsored-by: Westminster City Council <https://www.westminster.gov.uk/\> Signed-off-by: Hannah Dunne-Howrie <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected] website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
