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

--- Comment #1 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 203207
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203207&action=edit
Bug 43234: Add Koha::ILL::Requests->filter_by_purgeable

This patch adds a filter_by_purgeable() method to Koha::ILL::Requests
that returns a filtered resultset of ILL requests eligible for purging
based on status and age.

The method accepts:
- days: number of days since last update
- statuses: arrayref of status codes to match

The caller can use ->count for reporting or ->delete to purge,
following the standard Koha::Objects pattern.

Test plan:
1. Apply patch
2. Run:
   $ ktd --shell
   k$ prove t/db_dependent/Koha/ILL/Requests.t
=> SUCCESS: Tests pass
3. Tests cover:
   - Single status filter (COMP older than 30 days)
   - Multiple statuses (COMP + KILL)
   - Recent requests excluded by age threshold
   - Throws MissingParameter without days
   - Throws MissingParameter without statuses
   - Throws MissingParameter with empty statuses array
4. Sign off :-D

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