Koha-clms/t/Koha
Tomás Cohen Arazi b5041ae361
Bug 41728: Add Koha::Availability::Result base class
This patch introduces a standardized result class for availability checks,
providing a clean API with proper methods instead of raw hashrefs.

The Koha::Availability::Result class provides:
- add_blocker() - Add conditions that prevent the action
- add_confirmation() - Add conditions requiring user confirmation
- add_warning() - Add informational messages
- set_context() - Store related objects (item, checkout, patron, etc.)
- available() - Check if action can proceed (no blockers)
- needs_confirmation() - Check if confirmations are required
- Accessor methods for all categories
- to_hashref() for backward compatibility

This design:
- Provides a consistent interface across all availability checks
- Makes the API more discoverable and self-documenting
- Enables future enhancements without breaking changes
- Follows OO principles with proper encapsulation
- Can be used as base for checkout, hold, renewal availability

Test plan:
1. Apply patch
2. Run:
   $ ktd --shell
  k$ prove t/Koha/Availability/Result.t
=> SUCCESS: Tests pass!
3. Verify all methods work correctly
4. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-04 11:23:43 +00:00
..
Auth Bug 16631: Institute library limits 2026-07-28 14:32:25 +00:00
Authority
…
Availability Bug 41728: Add Koha::Availability::Result base class 2026-09-04 11:23:43 +00:00
Database
…
DateTime/Format
…
I18N/po/xx_XX/LC_MESSAGES
…
Installer
…
Middleware Bug 41197: Add unit tests 2026-08-19 14:33:52 +00:00
Object
…
Plugins
…
REST/Plugin Bug 43241: Add tests for timezone support in RFC3339 q= queries 2026-08-28 16:36:38 +00:00
Regex Bug 30233: (follow-up) Add tests for _apply_substitution and combined modifiers 2026-08-11 12:39:30 +00:00
Result
…
SearchEngine Bug 42764: Fix spelling errors across the codebase 2026-06-03 16:09:04 +00:00
Util Bug 35142: Remove GetNormalizedOCLCNumber, oclc_number, strip_orgcode 2026-08-20 15:34:07 +00:00
CSV.t Bug 41619: Add Koha::CSV 2026-02-06 15:17:02 -07:00
Config.t
…
ContentSecurityPolicy.t Bug 38365: Remove old usage of Koha::Cache::Memory::Lite 2026-03-16 11:57:31 +01:00
Email.t
…
Exceptions.t
…
I18N.t
…
ItemType.t
…
Manual.t
…
Script.t Bug 42714: (QA follow-up) Add tests for cronlogaction and Koha::Script logging 2026-07-28 14:32:39 +00:00
Script_cron.t Bug 42714: (QA follow-up) Add tests for cronlogaction and Koha::Script logging 2026-07-28 14:32:39 +00:00
Script_scrub_argv.t Bug 42766: Add tests for logscriptaction() and _scrub_argv() 2026-08-04 10:20:52 +00:00
Status.t Bug 41107: Add /status/version API endpoint 2026-03-23 09:33:54 +01:00
Z3950responder.t
…
sleep.pl
…
wait.pl
…