https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43234 Bug ID: 43234 Summary: Move ILL request purging logic to Koha::ILL::Requests Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: ILL Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org CC: lisette@bywatersolutions.com, pedro.amorim@openfifth.co.uk, tomascohen@gmail.com Depends on: 28740 Target Milestone: --- Follow-up from Bug 28740. Bug 28740 added ILL request purging to cleanup_database.pl using raw SQL in a PurgeIllRequests subroutine. This should be moved to a proper method on the Koha::ILL::Requests collection class. Proposed approach: - Add a filter method (e.g. filter_by_purgeable) that returns a filtered resultset - The script then calls ->count for dry-run or ->delete for actual purge - This follows the pattern used by other Koha::Objects subclasses Example usage in cleanup_database.pl: my $to_purge = Koha::ILL::Requests->filter_by_purgeable( { days => $days, statuses => \\@statuses } ); say sprintf('%d ILL requests would be removed', $to_purge->count) unless $confirm; $to_purge->delete if $confirm; Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 [Bug 28740] Delete old ILL requests with cleanup_database -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.