summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Model/InTransit.pm
diff options
context:
space:
mode:
authorDerf Null <derf@finalrewind.org>2023-03-10 16:57:31 +0100
committerDerf Null <derf@finalrewind.org>2023-03-10 16:57:31 +0100
commitf79e34fb622ddb5cf394da9928fa981c36ba3ad8 (patch)
treee71f6a09cd13bccec9bdf942ab6d803ccd8b5e93 /lib/Travelynx/Model/InTransit.pm
parent609d7b3ebc2ed0f190799da2565910cec7d79339 (diff)
worker: select on arr and dep eva for all arr/dep updates
still missing (TODO): add_route_timestamps
Diffstat (limited to 'lib/Travelynx/Model/InTransit.pm')
-rw-r--r--lib/Travelynx/Model/InTransit.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Travelynx/Model/InTransit.pm b/lib/Travelynx/Model/InTransit.pm
index 78fd297..6d445d5 100644
--- a/lib/Travelynx/Model/InTransit.pm
+++ b/lib/Travelynx/Model/InTransit.pm
@@ -333,6 +333,8 @@ sub update_departure {
my ( $self, %opt ) = @_;
my $uid = $opt{uid};
my $db = $opt{db} // $self->{pg}->db;
+ my $dep_eva = $opt{dep_eva};
+ my $arr_eva = $opt{arr_eva};
my $train = $opt{train};
my $route = $opt{route};
my $json = JSON->new;
@@ -358,7 +360,9 @@ sub update_departure {
},
{
user_id => $uid,
- train_no => $train->train_no
+ train_no => $train->train_no,
+ checkin_station_id => $dep_eva,
+ checkout_station_id => $arr_eva,
}
);
}
@@ -395,6 +399,7 @@ sub update_arrival {
my ( $self, %opt ) = @_;
my $uid = $opt{uid};
my $db = $opt{db} // $self->{pg}->db;
+ my $dep_eva = $opt{dep_eva};
my $arr_eva = $opt{arr_eva};
my $train = $opt{train};
my $route = $opt{route};
@@ -424,6 +429,7 @@ sub update_arrival {
{
user_id => $uid,
train_no => $train->train_no,
+ checkin_station_id => $dep_eva,
checkout_station_id => $arr_eva,
}
)->rows;