mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-23 04:06:27 +01:00
sig smartlock unlock and reserve_timerange
This commit is contained in:
parent
9026241a24
commit
15e266fa19
4 changed files with 12 additions and 7 deletions
|
@ -1854,6 +1854,8 @@ sub bikes_available(){
|
||||||
#new rental_description
|
#new rental_description
|
||||||
$return->{$id}->{rental_description}->{name} = "$tariff_content->{$tid}->{ct_name}";
|
$return->{$id}->{rental_description}->{name} = "$tariff_content->{$tid}->{ct_name}";
|
||||||
$return->{$id}->{rental_description}->{id} = "$tariff_content->{$tid}->{barcode}";
|
$return->{$id}->{rental_description}->{id} = "$tariff_content->{$tid}->{barcode}";
|
||||||
|
$return->{$id}->{rental_description}->{reserve_timerange} = "15 Min";
|
||||||
|
$return->{$id}->{rental_description}->{reserve_timerange} = "30 Min" if($record->{$id}->{int11} == 3);#sig timeout time
|
||||||
$return->{$id}->{rental_description}->{rental_info}->{1} = ["Tracking","Ich stimme der Speicherung (Tracking) meiner Fahrstrecke zwecks wissenschaftlicher Auswertung und Berechnung der CO2-Einsparung zu!"] if($record->{$id}->{int25});
|
$return->{$id}->{rental_description}->{rental_info}->{1} = ["Tracking","Ich stimme der Speicherung (Tracking) meiner Fahrstrecke zwecks wissenschaftlicher Auswertung und Berechnung der CO2-Einsparung zu!"] if($record->{$id}->{int25});
|
||||||
$return->{$id}->{rental_description}->{rental_info}->{2} = ["AGB","Mit der Mietrad Anmietung wird folgender Betreiber <a href='$varenv->{wwwhost}/site/agb.html' target='_blank'>AGB</a> zugestimmt (als Demo sharee AGB)."] if($auth->{c_id} && ($auth->{c_id} == 1842 || $auth->{c_id} == 5781 || $auth->{c_id} == 22262 || $auth->{c_id} == 38883));
|
$return->{$id}->{rental_description}->{rental_info}->{2} = ["AGB","Mit der Mietrad Anmietung wird folgender Betreiber <a href='$varenv->{wwwhost}/site/agb.html' target='_blank'>AGB</a> zugestimmt (als Demo sharee AGB)."] if($auth->{c_id} && ($auth->{c_id} == 1842 || $auth->{c_id} == 5781 || $auth->{c_id} == 22262 || $auth->{c_id} == 38883));
|
||||||
|
|
||||||
|
|
|
@ -150,10 +150,7 @@ sub sig_booking_update {
|
||||||
if($response_in->{event} eq "RENTAL_START"){
|
if($response_in->{event} eq "RENTAL_START"){
|
||||||
$response->{response_state} = "OK: methode not implemented, because rental will be started by App and success returned by sig-connector";
|
$response->{response_state} = "OK: methode not implemented, because rental will be started by App and success returned by sig-connector";
|
||||||
}
|
}
|
||||||
elsif($response_in->{event} eq "SMARTLOCK"){
|
elsif($response_in->{event} eq "RENTAL_END" || $response_in->{event} eq "RESERVATION_END" || ($response_in->{event} eq "SMARTLOCK" && $response_in->{data}->{lockStatus} eq "unlocked")){
|
||||||
$response->{response_state} = "OK: methode not implemented, because unlocking will be started by App and success returned by sig-connector";
|
|
||||||
}
|
|
||||||
elsif($response_in->{event} eq "RENTAL_END" || $response_in->{event} eq "RESERVATION_END"){
|
|
||||||
if($rentalId){
|
if($rentalId){
|
||||||
|
|
||||||
my $ctpos = {};
|
my $ctpos = {};
|
||||||
|
@ -181,16 +178,19 @@ sub sig_booking_update {
|
||||||
distance => $distance,
|
distance => $distance,
|
||||||
};
|
};
|
||||||
|
|
||||||
#addition state in context to get state=returned for miniquery
|
|
||||||
$sig_book->{station_lock_state} = "3" if($response_in->{event} eq "RENTAL_END");
|
|
||||||
|
|
||||||
my $authraw = { c_id => "" };
|
my $authraw = { c_id => "" };
|
||||||
$authraw->{c_id} = $ctpos->{ca_id} if($ctpos->{ca_id});
|
$authraw->{c_id} = $ctpos->{ca_id} if($ctpos->{ca_id});
|
||||||
$q->param(-name=>'bike',-value=>"$ctpos->{ct_name}") if($ctpos->{ct_name});
|
$q->param(-name=>'bike',-value=>"$ctpos->{ct_name}") if($ctpos->{ct_name});
|
||||||
$q->param(-name=>'state',-value=>"canceled") if($response_in->{event} eq "RESERVATION_END");
|
$q->param(-name=>'state',-value=>"canceled") if($response_in->{event} eq "RESERVATION_END");
|
||||||
|
|
||||||
|
if($response_in->{event} eq "SMARTLOCK" && $response_in->{data}->{lockStatus} eq "unlocked"){
|
||||||
|
$q->param(-name=>'lock_state',-value=>"unlocked");
|
||||||
|
}
|
||||||
if($response_in->{event} eq "RENTAL_END"){
|
if($response_in->{event} eq "RENTAL_END"){
|
||||||
$q->param(-name=>'state',-value=>"available");
|
$q->param(-name=>'state',-value=>"available");
|
||||||
$q->param(-name=>'lock_state',-value=>"locked");
|
$q->param(-name=>'lock_state',-value=>"locked");
|
||||||
|
#addition state in context to get state=returned for miniquery
|
||||||
|
$sig_book->{station_lock_state} = "3";
|
||||||
}
|
}
|
||||||
|
|
||||||
($rows, $booking_values) = $apif->booking_update($q,$varenv,$authraw,$aowner,$sig_book) if($authraw->{c_id});
|
($rows, $booking_values) = $apif->booking_update($q,$varenv,$authraw,$aowner,$sig_book) if($authraw->{c_id});
|
||||||
|
|
|
@ -203,6 +203,7 @@ sub sig_available {
|
||||||
#new rental_description
|
#new rental_description
|
||||||
$response_out->{$bike}->{rental_description}->{name} = "$tariff_content->{$tid}->{ct_name}";
|
$response_out->{$bike}->{rental_description}->{name} = "$tariff_content->{$tid}->{ct_name}";
|
||||||
$response_out->{$bike}->{rental_description}->{id} = "$tariff_content->{$tid}->{barcode}";
|
$response_out->{$bike}->{rental_description}->{id} = "$tariff_content->{$tid}->{barcode}";
|
||||||
|
$response_out->{$bike}->{rental_description}->{reserve_timerange} = "30 Min";
|
||||||
$response_out->{$bike}->{rental_description}->{rental_info}->{1} = ["Tracking","Ich stimme der Speicherung (Tracking) meiner Fahrstrecke zwecks wissenschaftlicher Auswertung und Berechnung der CO2-Einsparung zu!"];#TODO if($resp->{gps_tracker_id});
|
$response_out->{$bike}->{rental_description}->{rental_info}->{1} = ["Tracking","Ich stimme der Speicherung (Tracking) meiner Fahrstrecke zwecks wissenschaftlicher Auswertung und Berechnung der CO2-Einsparung zu!"];#TODO if($resp->{gps_tracker_id});
|
||||||
$response_out->{$bike}->{rental_description}->{rental_info}->{2} = ["AGB","Mit der Mietrad Anmietung wird folgender Betreiber <a href='$varenv->{wwwhost}/site/agb.html' target='_blank'>AGB</a> zugestimmt (als Demo sharee AGB)."] if($ctadr->{c_id} && ($ctadr->{c_id} == 1842 || $ctadr->{c_id} == 5781 || $ctadr->{c_id} == 22262));
|
$response_out->{$bike}->{rental_description}->{rental_info}->{2} = ["AGB","Mit der Mietrad Anmietung wird folgender Betreiber <a href='$varenv->{wwwhost}/site/agb.html' target='_blank'>AGB</a> zugestimmt (als Demo sharee AGB)."] if($ctadr->{c_id} && ($ctadr->{c_id} == 1842 || $ctadr->{c_id} == 5781 || $ctadr->{c_id} == 22262));
|
||||||
|
|
||||||
|
|
|
@ -319,6 +319,8 @@ sub fetch_rentalfeed {
|
||||||
#new rental_description
|
#new rental_description
|
||||||
$return->{rental_description}->{name} = "$ctpos->{txt04}";
|
$return->{rental_description}->{name} = "$ctpos->{txt04}";
|
||||||
$return->{rental_description}->{id} = "$ctpos->{int09}";
|
$return->{rental_description}->{id} = "$ctpos->{int09}";
|
||||||
|
$return->{rental_description}->{reserve_timerange} = "15 Min";
|
||||||
|
$return->{rental_description}->{reserve_timerange} = "30 Min" if($ctpos->{int11} == 3);
|
||||||
|
|
||||||
foreach my $td (sort keys (%$td_template)){
|
foreach my $td (sort keys (%$td_template)){
|
||||||
my $time_unit = "";
|
my $time_unit = "";
|
||||||
|
|
Loading…
Add table
Reference in a new issue