Bug 30663: Add Koha::Suggestions helper methods
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 3 May 2022 14:18:10 +0000 (11:18 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 5 May 2022 13:26:41 +0000 (10:26 -0300)
commitcec899902e9543913e229c9c6773c234814d9ccf
tree87e5c0e9cb805b8147a9036642d18d9b5974c795
parent10138c1a10efa5eda39af00a9ded1f1b95d23225
Bug 30663: Add Koha::Suggestions helper methods

This patch adds the following helper methods:

* filter_by_pending
* filter_by_suggested_days_range

This methods follow basically what's done in opac-suggestions.pl
I chose 'pending' as opposed to 'open' to follow what we use in the UI
which might be the case because of being more accurate for end users.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Suggestions.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/Suggestions.pm
t/db_dependent/Koha/Suggestions.t