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

--- Comment #91 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 209846
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209846&action=edit
Bug 42386: Add Koha::Patron::Availability::Hold

This patch adds patron-level hold availability checks using the
Koha::Result::Availability pattern. All blocker keys use snake_case.

Checks performed:
- Eligibility (no item context needed): expired, debt_limit,
  bad_address, card_lost, restricted, hold_limit (maxreserves
  syspref). debt_limit and hold_limit carry the totals as payload.
- Count limits (with item_type_id + library_id context):
  no_reserves_allowed, too_many_holds_for_this_record,
  too_many_reserves_today, too_many_reserves (reservesallowed and
  max_holds)

Hold counts are group-aware (Koha::Holds->count_holds): a hold group
counts as one hold, including against maxreserves. The reservesallowed
count is scoped like the legacy code: by item home library when
ReservesControlBranch is ItemHomeLibrary, and by itemtype when the
matching rule is itemtype-specific, using the item's own itype first
when item-level_itypes is set.

The skip_eligibility parameter skips the eligibility gates, for
callers that already checked them once.

Test plan:
1. Apply patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Patron/Availability/Hold.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Co-authored-by: Martin Renvoize <[email protected]>
Assisted-by: Opus 5.5 (Anthropic)

-- 
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