[GIT] Evergreen ILS branch main updated. 56f757de7e5ab3dfa67a18f8e37bbca209def35f

This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Evergreen ILS". The branch, main has been updated via 56f757de7e5ab3dfa67a18f8e37bbca209def35f (commit) from d18e5107816dd44cbcde715814a78237a3bd7690 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 56f757de7e5ab3dfa67a18f8e37bbca209def35f Author: Jason Stephenson <jason@sigio.com> Date: Fri May 16 16:12:35 2025 -0400 LP 2110251: Add renewal field to orc object The circ object had a nonfunctional "renewals" link defined in the fm_IDL.xml file. This commit makes that link work, retypes it from a "has_many" to a "might_have" link and renames it to "renewal." A Perl test file is included to verify that the field is properly defined. The link is a "might_have" link instead of a "has_many" because no single circulation can logically have more than 1 renewal in the database since a renewal creates a new circulation. It is also common for circulations to not be renewed. Evergreen proper does not use this field, yet. It is included because it may simplify utility scripts used by Evergreen sites. Release-note: Add a renewal link to the circ object in order to retrieve renewals more efficiently. Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Mike Rylander <mrylander@gmail.com> diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index b8e9d0ef68..35b82142ab 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -5123,6 +5123,7 @@ SELECT usr, <field reporter:label="Archived Item Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/> <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/> <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int"/> + <field reporter:label="Renewal" name="renewal" oils_persist:virtual="true" reporter:datatype="link"/> </fields> <links> <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/> @@ -5143,7 +5144,7 @@ SELECT usr, <link field="workstation" reltype="has_a" key="id" map="" class="aws"/> <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/> <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/> - <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/> + <link field="renewal" reltype="might_have" key="parent_circ" map="" class="circ"/> <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/> <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/> <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/> diff --git a/Open-ILS/src/perlmods/t/lp2110251-circ-renewal-field.t b/Open-ILS/src/perlmods/t/lp2110251-circ-renewal-field.t new file mode 100755 index 0000000000..31c65622ab --- /dev/null +++ b/Open-ILS/src/perlmods/t/lp2110251-circ-renewal-field.t @@ -0,0 +1,33 @@ +#!perl +use strict; use warnings; +use Test::More tests => 5; +use OpenILS::Utils::TestUtils; +use OpenILS::Const qw(:const); +use OpenILS::Utils::Fieldmapper; +use Data::Dumper; + +my $script = OpenILS::Utils::TestUtils->new(); + +$script->bootstrap(); + +diag('LP2110251 Verify Circ Renewal Field'); + +my $circ = Fieldmapper::action::circulation->new; + +# Check that the renewal field exists. +ok($circ->has_field('renewal'), 'circ object has renewal field'); + +# Check that it is a link +is($circ->FieldDatatype('renewal'), 'link', 'circ renewal field is a link'); +SKIP: { + # Check link properties if Fieldmapper supports it, 3.15+ + eval { + my $link = $circ->FieldLink('renewal'); + is($link->{class}, 'circ', 'renwal links to circ'); + is($link->{key}, 'parent_circ', 'renewal key field is parent_circ'); + is($link->{reltype}, 'might_have', 'renewal is a "might_have" link'); + }; + if ($@) { + skip 'test not supported by your Fieldmapper', 3; + } +}; ----------------------------------------------------------------------- Summary of changes: Open-ILS/examples/fm_IDL.xml | 3 +- .../src/perlmods/t/lp2110251-circ-renewal-field.t | 33 ++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100755 Open-ILS/src/perlmods/t/lp2110251-circ-renewal-field.t hooks/post-receive -- Evergreen ILS
participants (1)
-
Git User