sig without reserve fix

This commit is contained in:
ragu 2022-06-21 15:30:22 +02:00
parent c7726be759
commit c5dbb5bff6
6 changed files with 23 additions and 12 deletions

View file

@ -261,8 +261,8 @@ elsif($q->param('request') eq "booking_request"){
};
if($ct_bike->{barcode} && $ct_tariff->{barcode}){
#sig reservation. not mandatory
if($ct_bike->{int11} == 3){
#sig reservation. not mandatory, disabled because sig seems to get confused
if(1==2 && $ct_bike->{int11} == 3){
$sig_book = $si->sig_booking(\%varenv,"reserve",$authraw,$ct_bike,"");
$sig_book->{bikeId} = "$ct_bike->{txt22}";
#we only need rentalId because of reserve/end uses rentalId
@ -295,7 +295,8 @@ elsif($q->param('request') eq "booking_request"){
if($ctpos->{int11} == 3){
#usecase with reservationId (in ctpos) is in sig not defined, thats because using ct_bike.txt22
#$sig_book = $si->sig_booking(\%varenv,"rental",$authraw,$ct_bike,$ctpos);
system("$varenv{basedir}/src/scripts/sig_client.pl $varenv{syshost} 'rental' $authraw->{c_id} '' $ctpos->{c_id} &");
#we have to use $ct_bike->{txt22} because we doesn't using sig reserve in this case
system("$varenv{basedir}/src/scripts/sig_client.pl $varenv{syshost} 'rental' $authraw->{c_id} $ct_bike->{txt22} '' &");
$sig_book->{rentalId} = "$R::rentalId" if($R::rentalId);#only for cmd tests
($rows, $booking_values) = $apif->booking_update($q,\%varenv,$authraw,$aowner,$sig_book);
$response = {%$response, %$booking_values};

View file

@ -271,6 +271,7 @@ sub sig_available {
}#end sig_available
#POST resverve, rental, ...
#will be called by sig_client
sub sig_booking {
my $self = shift;
my $varenv = shift || {};
@ -284,7 +285,7 @@ sub sig_booking {
my $sig_book = {};
open(FILE,">>$varenv->{logdir}/APIsigclient.log");
print FILE "\n*** $now_dt 'sig_post $todo' \n";
print FILE "\n2. *** $now_dt 'sig_post $todo' \n";
my $endpoint = "$dbt->{operator}->{$varenv->{dbname}}->{endpoint}/";
my %json = ();

View file

@ -279,7 +279,7 @@ sub channel_map(){
167 => "sig cmd",
168 => "shareeio",
169 => "sig connector",
172 => "cron timeout",
172 => "reserve timeout",
#173 => "merchant fallback",#mig
#175 => "example App",#mig
176 => "Mein konrad App",#mig

View file

@ -285,9 +285,15 @@ sub fetch_rentalfeed {
my $return = {};
$return->{bike_group} = ["$bike_group"];
$return->{station} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$ctpos->{int04}";#TODO save with prefix
$return->{uri_operator} = "$varenv->{wwwhost}";#TODO, should be DB select
#TOD save with prefix
$return->{station} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$ctpos->{int04}";
$return->{uri_operator} = "$varenv->{wwwhost}";#TOD, should be DB select
$return->{bike} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$ctpos->{barcode}";
#TOD save also sig prefix
if($dbt->{operator}->{$varenv->{dbname}}->{oprefix} eq "SX"){
$return->{bike} = "S3X$ctpos->{barcode}";
#$return->{station} = "S3X$ctpos->{int04}";
}
$return->{state} = "$dbt->{copri_conf}->{bike_state}->{$ctpos->{int10}}" || "";
$return->{bike_charge} = "$ctpos->{int19}" if($ctpos->{int19});
$return->{description} = "$ctpos->{txt01}";

View file

@ -6,7 +6,7 @@
#On this forking script, nothing will saved on script, else by execute APIsigclient methodes
#
# command line syntax
# sudo su www-data -c "./src/scripts/sig_client.pl shareeapp-sx 'todo' 'user_id' 'bike_id' 'pos_id'"
# sudo su www-data -c "./src/scripts/sig_client.pl shareeapp-sx 'todo' 'user_id' 'sig bikeId' 'pos_id'"
#
# sudo su www-data -c "./src/scripts/sig_client.pl shareeapp-sx bikes_available"
#
@ -41,11 +41,11 @@ my $dbh = "";
my $todo = $ARGV[1] || "";
my $user_id = $ARGV[2] || "";
my $bike_id = $ARGV[3] || "";
my $pos_id = $ARGV[4] || "";
my $bike_id = $ARGV[3] || "";#from content.txt22
my $pos_id = $ARGV[4] || "";#from contenttranspos.c_id
open(FILE,">>$varenv{logdir}/APIsigclient.log");
print FILE "\n*** $now_dt 'sig_client fork with todo:$todo|user_id:$user_id|pos_id:$pos_id' \n";
print FILE "\n1. *** $now_dt 'sig_client fork with todo:$todo|user_id:$user_id|bike_id:$bike_id|pos_id:$pos_id' \n";
#get user and bike in copri by id
my $apref = {
@ -101,7 +101,7 @@ elsif($todo eq "reserve"){
}
#live! Fork rental request with bike "id"
elsif($todo eq "rental" && $ctadr->{c_id} > 0 && $ctpos->{txt22}){
elsif($todo eq "rental" && $ctadr->{c_id} > 0){
#$ctadr = { c_id => 1842 };
#$ct_bike = { txt22 => "380116b5-0522-43da-ab66-477744a731a3" };
my $return = $si->sig_booking(\%varenv,$todo,$ctadr,$ct_bike,$ctpos);

View file

@ -675,6 +675,9 @@ Nach Abschluss der Registrierung erhalten Sie sowohl auf die von Ihnen hinterleg
}#ende e-Mail iif
print $q->div({-class=>'content2'}, "Bei Problemen während der Registrierung bitte unsere Account-hotline <a href='mailto:hotline\@sharee.bike'>hotline\@sharee.bike</a> kontaktieren."),"\n" if($project eq "Bayern" && $path =~ /$varenv->{accounting_1}|$varenv->{accounting_3}/);
print "</div>\n";
print $q->end_form,"\n";