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

            Bug ID: 43126
           Summary: REST API: add holdability endpoints for biblios, items
                    and patrons
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: REST API
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected]
        Depends on: 43124
            Blocks: 43123
  Target Milestone: ---

Add new REST endpoints built on Koha::Biblio::Availability::Hold and
Koha::Item::Availability::Hold (bug 43124).

GET /biblios/{biblio_id}/holdability, a single call biblio level holdability
verdict plus an item availability summary, replacing the current
CanBookBeReserved plus per-item loop pattern.

GET /items/{item_id}/holdability, a per-item holdability verdict. Pickup
locations are only included when include_pickup_locations=true is passed.

POST /biblios/{biblio_id}/holdability/batch, checks holdability for multiple
patrons (club holds) or multiple items in a single call.

GET /patrons/{patron_id}/hold_eligibility, patron level blockers (debt,
restricted, expired, etc) independent of any specific biblio. This is a thin
new controller action over the existing Koha::Patron->can_place_holds method,
not new backend logic.

Also enhance the existing GET /biblios/{biblio_id}/items endpoint with an
optional holdability parameter that embeds a per-item holdability object when
true and a patron_id is supplied, alongside pagination.

Response bodies for the new holdability endpoints serialise the blockers,
confirmations and warnings shape of Koha::Result::Availability rather than a
bespoke status enum schema.

All existing hold endpoints (POST /holds, PATCH and DELETE /holds/{hold_id},
pickup_locations endpoints, suspension_bulk, cancellation_bulk) are unchanged.

Test plan
1. Add OpenAPI definitions for each new endpoint under api/v1/swagger.
2. Add controller tests under t/db_dependent/api/v1 for each endpoint, covering
holdable, non-holdable and override-required cases.
3. Confirm GET /biblios/{biblio_id}/holdability for a 100 item biblio completes
in well under 1 second and issues a small, roughly constant number of queries.
4. Confirm existing hold endpoints are unaffected.


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43123
[Bug 43123] Hold placement workflow: Vue modernisation (epic)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43124
[Bug 43124] Add Koha::Item::Availability::Hold and
Koha::Biblio::Availability::Hold
-- 
You are receiving this mail because:
You are the assignee for the bug.
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