cleanup and filter support
All checks were successful
Create and publish a Docker image / build-and-push-image (push) Successful in 39s

This commit is contained in:
Nicholas Orlowsky 2026-02-21 15:26:48 -05:00
parent 6773e6ae30
commit 3f68335eb4
No known key found for this signature in database
GPG key ID: A9F3BA4C0AA7A70B
62 changed files with 2364 additions and 1901 deletions

View file

@ -1,3 +1,5 @@
use std::cmp::Ordering;
use serde::{Deserialize, Serialize};
#[derive(sqlx::Type, Serialize, Deserialize, PartialEq, Debug, Clone)]
@ -7,7 +9,7 @@ pub enum RouteType {
SubwayElevated,
RegionalRail,
Bus,
TracklessTrolley
TracklessTrolley,
}
#[derive(::sqlx::FromRow, Serialize, Deserialize, Debug, Clone)]
@ -16,13 +18,33 @@ pub struct Route {
pub short_name: String,
pub color_hex: String,
pub route_type: RouteType,
pub id: String
pub id: String,
pub directions: Vec<crate::direction::Direction>,
}
impl PartialEq for Route {
fn eq(&self, other: &Self) -> bool {
self.id == other.id
}
}
impl Eq for Route {}
impl Ord for Route {
fn cmp(&self, other: &Self) -> Ordering {
self.id.cmp(&other.id)
}
}
impl PartialOrd for Route {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.id.cmp(&other.id))
}
}
#[derive(::sqlx::FromRow, Serialize, Deserialize, Debug, Clone)]
pub struct InterlinedRoute {
pub interline_id: String,
pub interline_name: String,
pub interlined_routes: Vec<String>
pub interlined_routes: Vec<String>,
}