Browse Source

Bug 32537: Add no-block option to SIP cli emulator

This patch adds the option to pass a no-block option and use this
in checkout/checkin/renew messages

To test:
1 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000010831
2 - Confirm out like:
    SEND: 09N20221227    20183920221227    201839APCPL|AOCPL|AB39999000010831|ACterm1|BIN|
    (Note the N after 09)
3 - Apply patch
4 - Restart SIP, repeat 1
5 - Confirm still an N
6 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000010831 -n N
7 - Confirm still an N
8 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkin --item 39999000010831 -n Y
9 - Confirm the send has a Y after 09

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23.05.x
Nick Clemens 1 year ago
committed by Tomas Cohen Arazi
parent
commit
0880d80949
Signed by: tomascohen GPG Key ID: 0A272EA1B2F3C15F
  1. 11
      misc/sip_cli_emulator.pl

11
misc/sip_cli_emulator.pl

@ -54,6 +54,7 @@ my $fee_identifier;
my $transaction_id;
my $pickup_location;
my $hold_mode;
my $no_block;
my $terminator = q{};
@ -83,6 +84,7 @@ GetOptions(
"transaction-id=s" => \$transaction_id,
"pickup-location=s" => \$pickup_location,
"hold-mode=s" => \$hold_mode,
"n|no-block=s" => \$no_block,
"t|terminator=s" => \$terminator,
@ -101,6 +103,8 @@ if ( $help
exit();
}
$no_block //= 'N';
$terminator = ( $terminator eq 'CR' ) ? $CR : $CRLF;
# Set perl to expect the same record terminator it is sending
@ -174,7 +178,7 @@ my $handlers = {
subroutine => \&build_checkout_command_message,
parameters => {
SC_renewal_policy => 'Y',
no_block => 'N',
no_block => $no_block,
transaction_date => $transaction_date,
nb_due_date => undef,
institution_id => $location_code,
@ -198,7 +202,7 @@ my $handlers = {
name => 'Checkin',
subroutine => \&build_checkin_command_message,
parameters => {
no_block => 'N',
no_block => $no_block,
transaction_date => $transaction_date,
return_date => $transaction_date,
current_location => $location_code,
@ -220,7 +224,7 @@ my $handlers = {
subroutine => \&build_renew_command_message,
parameters => {
third_party_allowed => 'N',
no_block => 'N',
no_block => $no_block,
transaction_date => $transaction_date,
nb_due_date => undef,
institution_id => $location_code,
@ -654,6 +658,7 @@ Options:
--transaction-id Transaction id for Fee Paid message, optional
--pickup-location Pickup location (branchcode) for Hold message, optional
--hold-mode Accepts "+" to add hold or "-" to cancel hold, defaults to +
-n --no-block Accepts "N" for standard operatoin, "Y" for no-block, defaults to "N"
-m --message SIP2 message to execute

Loading…
Cancel
Save