]> git.evergreen-ils.org Git - working/Evergreen.git/commit - Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
LP 1904737: Expand copy statuses for the pull list
authorJason Stephenson <jason@sigio.com>
Tue, 27 Jun 2023 18:42:22 +0000 (14:42 -0400)
committerJane Sandberg <js7389@princeton.edu>
Tue, 24 Oct 2023 22:28:33 +0000 (15:28 -0700)
commited161bb9d9dbbe5bd7543fcc06d6069aba288bec
treef2ff433ff547cca099b38bcd5abdb46fdf2ae432
parent1499e5285ec6c06ca8657a1d3f5fa7ffc2d0eddd
LP 1904737: Expand copy statuses for the pull list

Evergreen limits copies on the pull list to those with hard coded
status values of 0 or 7.  This commit expands the range of copies
available to fill holds to any copy whose status has both the holdable
and is_available fields set to true.  This modification affords sites
more control over what copy statuses can fill holds, including custom
ones.

The hold targeter and database functions that calculate counts of
copies available to fill holds are also modified to use the new logic.

In order to maintain timely performance, new indexes are created on
the asset copy and serial unit table circ_lib columns the deleted
column is false.  The previous indexes on these columns where the copy
status is 0 or 7 are dropped.  Queries that used the old indexes are
modified to use the new indexes.

A database regression tests are added to check that the new indexes
exist and the the old indexes do not.

Live tests are added to the live_t/20-hold-targeter.t test suite to
exercise the new functionality and verify that it works as expected
for the hold targeter and the asset.staff_ou_metarecord_copy_count
database function.  (If someone could figure out a decent way to live
test the pull list and the other database functions, that would be
great.)

On a default system, only statuses 0 and 7 match the new criteria to
fill holds, so testing the pull list would amount to checking that the
behavior has not changed after installation of the new code.

In order to verify that the change actually works, one could add a new
status or modify an existing status so that the holdable and
is_available fields are true.  After running the hold targeter, a
different number of copies should be available to fill some holds.
Different copies may appear on the pull list as a result.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: John Amundson <jamundson@cwmars.org>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
12 files changed:
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.ts
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm
Open-ILS/src/perlmods/live_t/20-hold-targeter.t [changed mode: 0644->0755]
Open-ILS/src/sql/Pg/040.schema.asset.sql
Open-ILS/src/sql/Pg/100.circ_matrix.sql
Open-ILS/src/sql/Pg/210.schema.serials.sql
Open-ILS/src/sql/Pg/t/regress/lp1904737_has_indexes.pg [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.schema-expand-status-for-hold-pull-list.sql [new file with mode: 0644]
docs/RELEASE_NOTES_NEXT/Circulation/expansion_of_copy_status_for_holds.adoc [new file with mode: 0644]