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 $item2_on_hold_barcode);
+ $item_barcode $item_title $item_owner $item2_on_hold_barcode
+ $item3_on_hold_barcode_for_br1);
my $patron_info_test_template = {
id => 'valid Patron Info no details',
required => 1, },
], };
+my $checkin_test_template = {
+ id => 'Checkin: Item is checked out',
+ msg => "09N20060102 08423620060113 084235APUnder the bed|AO$instid|AB$item_barcode|ACterminal password|",
+ pat => qr/^101YNN$datepat/o,
+ fields => [],
+};
+
+my $checkout_template = {
+ id => 'Checkin: prep: check out item',
+ msg => "11YN20060329 203000 AO$instid|AA$user_barcode|AB$item_barcode|AC|",
+ pat => qr/^121NNY$datepat/o,
+ fields => [],
+};
+
my @tests = (
$SIPtest::login_test,
$SIPtest::sc_status_test,
clone($patron_status_test_template),
clone($item_info_test_template),
clone($item2_on_hold_info_test_template),
+ $checkout_template,
+ clone($checkin_test_template),
);
$test->{id} = "Item Info destination location extension";
push @{$test->{fields}}, {
field => FID_DESTINATION_LOCATION,
- pat => qr/^BR4$/o,
+ pat => qr/^BM1$/o,
just_warn => 1, required => 1, };
push @tests, $test;
push @tests, $test;
}
+sub create_maybe_deprecated_extension_tests {
+ # SIP Extensions by 3M spec: Document Revision 1.20, 02/14/2005
+ # I don't actually see these in a 2.00 document, but in 1.20 they
+ # are optional extensions for the checkin response
+
+ my $test = clone($checkin_test_template);
+ $test->{id} = "Checkin response collection code extension";
+ push @tests, $checkout_template;
+ push @{$test->{fields}}, {
+ field => FID_COLLECTION_CODE,
+ pat => qr/^Young Adult Fiction$/o,
+ just_warn => 1, required => 1, };
+ push @tests, $test;
+
+ $test = clone($checkin_test_template);
+ $test->{id} = "Checkin response call number extension";
+ push @tests, $checkout_template;
+ push @{$test->{fields}}, {
+ field => FID_CALL_NUMBER,
+ pat => qr/^ML 2533 B34 C3$/o,
+ just_warn => 1, required => 1, };
+ push @tests, $test;
+
+ $test = clone($checkin_test_template);
+ $test->{msg} =~ s/$item_barcode/$item2_on_hold_barcode/g;
+ $test->{pat} = qr/^101YN[YN]$datepat/o; # let alert field in leader be Y or N
+ $test->{id} = "Checkin response destination location extension";
+ # No need to check this out; we should have a transit for it
+ push @{$test->{fields}}, {
+ field => FID_DESTINATION_LOCATION,
+ pat => qr/^BM1$/o,
+ just_warn => 1, required => 1, };
+ push @tests, $test;
+
+ $test = clone($checkin_test_template);
+ $test->{msg} =~ s/$item_barcode/$item3_on_hold_barcode_for_br1/g;
+ $test->{pat} = qr/^101YN[YN]$datepat/o; # let alert field in leader be Y or N
+ $test->{id} = "Checkin response hold patron ID extension";
+ # No need to check this out, we're just interested in hold routing being triggered
+ push @{$test->{fields}}, {
+ field => FID_HOLD_PATRON_ID,
+ pat => qr/^99999354444$/o,
+ just_warn => 1, required => 1, };
+ push @tests, $test;
+
+ $test = clone($checkin_test_template);
+ $test->{msg} =~ s/$item_barcode/$item3_on_hold_barcode_for_br1/g;
+ $test->{pat} = qr/^101YN[YN]$datepat/o; # let alert field in leader be Y or N
+ $test->{id} = "Checkin response hold patron ID extension";
+ # No need to check this out, we're just interested in hold routing being triggered
+ push @{$test->{fields}}, {
+ field => FID_HOLD_PATRON_NAME,
+ pat => qr/^Edward David Ellis$/o, # the standard doesn't actually specify how names are formatted
+ 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();
+create_maybe_deprecated_extension_tests();
SIPtest::run_sip_tests(@tests);
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');
+INSERT INTO action.hold_transit_copy (source_send_time, target_copy, source, dest, copy_status, persistant_transfer, hold)
+ VALUES (NOW(), 317, 4, 9, 0, 'f', 158);
+
+UPDATE action.hold_request SET pickup_lib = 4, request_lib = 4, selection_ou = 4 WHERE id = 254;
+UPDATE asset.copy SET circ_lib = 4 WHERE id = 485;
+INSERT INTO action.hold_copy_map (hold, target_copy, proximity) VALUES (254, 485, 0);