test item info destination location extension
authorJason Etheridge <jason@EquinoxOLI.org>
Sat, 26 Nov 2022 14:40:20 +0000 (09:40 -0500)
committerJason Etheridge <jason@EquinoxOLI.org>
Sat, 26 Nov 2022 14:40:20 +0000 (09:40 -0500)
t/17extensions.t
t/SIPtest.pm
t/augment_concerto.sql

index 7e3e81f..4e08b7d 100755 (executable)
@@ -8,7 +8,7 @@ use Sip::Constants qw(:all);
 use SIPtest qw($datepat $textpat $instid $currency $user_barcode $user_pin
     $user_fullname $user_homeaddr $user_email $user_phone
     $user_birthday $user_ptype $user_inet $user_homelib
-    $item_barcode $item_title $item_owner);
+    $item_barcode $item_title $item_owner $item2_on_hold_barcode);
 
 my $patron_info_test_template = {
     id => 'valid Patron Info no details',
@@ -93,7 +93,7 @@ my $patron_status_test_template = {
 my $item_info_test_template = {
     id => 'Item Information: check information for available item',
     msg => "1720060110    215612AO$instid|AB$item_barcode|",
-    pat => qr/^180[139]0201$datepat/, # status of 'other' or 'available'
+    pat => qr/^180[139]0201$datepat/, # status of 'other' or 'available' or 'waiting to be re-shelved'
     fields => [
         $SIPtest::field_specs{(FID_SCREEN_MSG)},
         $SIPtest::field_specs{(FID_PRINT_LINE)},
@@ -111,12 +111,25 @@ my $item_info_test_template = {
             required => 0, },
 ], };
 
+my $item2_on_hold_info_test_template = {
+    id => 'Item Information: check information for item on hold',
+    msg => "1720060110    215612AO$instid|AB$item2_on_hold_barcode|",
+    pat => qr/^18100201$datepat/, # status of 'in transit between library locations'
+    fields => [
+        $SIPtest::field_specs{(FID_SCREEN_MSG)},
+        $SIPtest::field_specs{(FID_PRINT_LINE)},
+        { field    => FID_ITEM_ID,
+            pat      => qr/^$item2_on_hold_barcode$/,
+            required => 1, },
+], };
+
 my @tests = (
     $SIPtest::login_test,
     $SIPtest::sc_status_test,
     clone($patron_info_test_template),
     clone($patron_status_test_template),
     clone($item_info_test_template),
+    clone($item2_on_hold_info_test_template),
 );
 
 
@@ -224,9 +237,31 @@ sub create_ils_defined_protocol_extension_tests {
 
 }
 
+sub create_amh_sorting_extension_tests {
+
+    # SIP Extension by Evergreen for AMH: 10/01/2001
+    my $test = clone($patron_info_test_template);
+    $test->{id} = "Patron Info internal ID extension";
+    push @{$test->{fields}}, {
+        field    => 'XI',
+        pat      => qr/^71$/o,
+        just_warn => 1, required => 1, };
+    push @tests, $test;
+
+    # Extension for AMH sorting
+    $test = clone($item2_on_hold_info_test_template);
+    $test->{id} = "Item Info destination location extension";
+    push @{$test->{fields}}, {
+        field    => FID_DESTINATION_LOCATION,
+        pat      => qr/^BR4$/o,
+        just_warn => 1, required => 1, };
+    push @tests, $test;
+}
+
 create_patron_info_extension_tests();
 create_patron_status_extension_tests();
 create_ils_defined_protocol_extension_tests();
+create_amh_sorting_extension_tests();
 
 SIPtest::run_sip_tests(@tests);
 
index 39ce41a..01bc624 100644 (file)
@@ -46,7 +46,7 @@ our @EXPORT_OK = qw(run_sip_tests no_tagged_fields
             $cancel_hold_user_barcode $user_with_fees_barcode
             $item_barcode $item_title $item_owner
             $item2_barcode $item2_title $item2_owner
-            $item_on_hold_barcode
+            $item_on_hold_barcode $item2_on_hold_barcode
             $item_diacritic_barcode $item_diacritic_title
             $item_diacritic_owner);
 
@@ -104,6 +104,9 @@ our $second_user_homelib  = 'BM1';
 # and an item they have a copy level hold for
 our $item_on_hold_barcode = 'CONC70000345';
 
+# another on hold item with a transit
+our $item2_on_hold_barcode = 'CONC70000352';
+
 # Valid user (that we will deactivate later) barcode and corresponding user password/pin and full name
 our $block_user_barcode  = '99999391951';
 our $block_user_pin      = 'mistyg1234';
index 26145b2..0d0831a 100644 (file)
@@ -33,4 +33,6 @@ INSERT INTO asset.stat_cat_entry(stat_cat, owner, value)
 INSERT INTO asset.stat_cat_entry_copy_map (stat_cat, stat_cat_entry, owning_copy) 
     VALUES (1, 2, 2003);
 
+INSERT INTO action.transit_copy (source_send_time, target_copy, source, dest, copy_status, persistant_transfer)
+    VALUES (NOW(), 317, 4, 7, 0, 'f');