https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383

--- Comment #86 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 209746
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209746&action=edit
Bug 42383: Add checkin sub-resource confirmation/cancellation endpoints

Adds the hold/transfer/recall confirmation and cancellation sub-resource
endpoints on top of the checkin REST API:

* POST /checkins/{checkin_id}/hold_confirmation
* POST /checkins/{checkin_id}/hold_cancellation
* POST /checkins/{checkin_id}/transfer_confirmation
* POST /checkins/{checkin_id}/transfer_cancellation
* POST /checkins/{checkin_id}/recall_confirmation

Each delegates to the matching Koha::Checkin method and renders a shared
201 response via _render_checkin_response (Location header included).

The module policy is returned, in the `policy` attribute of the error
object, only on the permission error paths (exempt_fine,
forgive_hold_fees, return_date), not on success responses: the Vue app
is hydrated with the policy at template load time, so recomputing it on
every successful checkin would waste CPU. The client refreshes its view
of the policy exactly when it is stale: when the server refuses a
request because of it.

The checkin definition gains the full `messages` documentation and the
availability definition its confirms/item_parts additions. The error
definition gains the optional `policy` attribute, described by the new
module_policy, module_policy_global and checkin_policy definitions.

Test plan:
1. Apply patch
2. Run:
   $ ktd --shell
  k$ prove xt/api.t t/db_dependent/api/v1/checkins.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Assisted-by: Sonnet 4.6 (Anthropic)
Signed-off-by: Brendan Lawlor <[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/

Reply via email to