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

--- Comment #216 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 211708
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211708&action=edit
Bug 42383: Add check-in follow-up action endpoints

This patch adds the follow-up action sub-resources to the check-in 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 one delegates to the matching Koha::Checkin method, requires the
action token returned with the check-in, and returns the updated
check-in. They are rejected (409) when the item has been checked in
again (stale_checkin) or checked out again (item_checked_out) since.

POST /checkins and GET /checkins/availability are adjusted to the needs
of the check-in page: messages, pending actions and action tokens in the
response, barcode filters applied, item parts and bundle confirmations.
As the legacy returns page did, POST /checkins cancels the waiting holds
of the item for which cancellation has been requested before the return.
A blocked check-in (withdrawn, lost, wrong library) is answered with 403
(checkin_blocked), but AddReturn is still called, as the legacy returns
page did: the check-in, the local use, the date last seen and the
location and not for loan updates are recorded.
If AddReturn cannot return the item (e.g. because of a data problem),
POST /checkins answers 500 (checkin_failed) and skips the post-return
processing. The internal error is logged, not returned.

All the check-in endpoints are marked EXPERIMENTAL in the spec: they
serve the new check-in page, and may still change.

The error definition gains an optional 'policy' attribute (module_policy,
module_policy_global and checkin_policy definitions), returned when a
request is refused because of the module policy.

Test plan:
1. Apply patch
2. Run:
   $ ktd --shell
  k$ yarn api:bundle
  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)
Assisted-by: Opus 5.5 (Anthropic)
Signed-off-by: Brendan Lawlor <[email protected]>
Signed-off-by: Matt Blenkinsop <[email protected]>
Signed-off-by: Martin Renvoize <[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