From 8e94fcea5ff99023c108da0f58abb421f16454e8 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 22 Jan 2023 12:33:02 +0100 Subject: move token type to ID map from Travelynx.pm to Model/Users --- lib/Travelynx/Model/Users.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/Travelynx/Model') diff --git a/lib/Travelynx/Model/Users.pm b/lib/Travelynx/Model/Users.pm index 0287ca2..46ffbdd 100644 --- a/lib/Travelynx/Model/Users.pm +++ b/lib/Travelynx/Model/Users.pm @@ -19,6 +19,12 @@ my @sb_templates = ( [ 'bahn.expert/regional', 'https://bahn.expert/regional/{name}#{id}' ], ); +my %token_id = ( + status => 1, + history => 2, + travel => 3, + import => 4, +); my @token_types = (qw(status history travel import)); sub new { @@ -27,6 +33,12 @@ sub new { return bless( \%opt, $class ); } +sub get_token_id { + my ( $self, $type ) = @_; + + return $token_id{$type}; +} + sub mark_seen { my ( $self, %opt ) = @_; my $uid = $opt{uid}; -- cgit v1.2.3