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

--- Comment #4 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 192133
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192133&action=edit
[POC] Bug 41728: Add Koha::Item::Checkout::Availability class

This is for illustration purposes only! Not intended to be tested or pushed.

This patch introduces a checkout availability class that wraps
C4::Circulation::CanBookBeIssued in a Result object interface,
providing a consistent API for availability checks.

The class:
- Wraps CanBookBeIssued and maps its return values to Result object
- Maps 'impossible' to blockers
- Maps 'confirmation' to confirmations
- Maps 'alerts' and 'messages' to warnings
- Provides $item->checkout_availability() convenience method

This enables the REST API and other code to use a consistent
availability checking interface across different operations
(checkout, check-in, renewal, etc.).

Test plan:
1. Apply patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Item/Checkout/Availability.t
=> SUCCESS: Tests pass!
3. Verify checkout availability checks work:
   - Available items return no blockers
   - Debarred patrons get DEBARRED blocker
   - Context includes patron and item objects
4. Sign off :-D

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to