revert to septa api for rt tracking

This commit is contained in:
Nicholas Orlowsky 2025-11-08 13:12:07 -05:00
parent f407992035
commit a335f14b14
No known key found for this signature in database
GPG key ID: A9F3BA4C0AA7A70B
18 changed files with 535 additions and 355 deletions

View file

@ -1,7 +1,7 @@
use serde::{Deserialize, Serialize};
#[derive(sqlx::Type, Serialize, Deserialize, PartialEq, Debug, Clone)]
#[derive(sqlx::Type, Serialize, Deserialize, PartialEq, Debug, Clone, Copy, Eq)]
#[sqlx(type_name = "septa_direction_type", rename_all = "snake_case")]
pub enum CardinalDirection {
Northbound,
@ -15,8 +15,6 @@ pub enum CardinalDirection {
#[derive(::sqlx::Decode, Serialize, Deserialize, Debug, Clone)]
pub struct Direction {
pub route_id: String,
pub direction_id: i64,
pub direction: CardinalDirection,
pub direction_destination: String
}

View file

@ -1,4 +1,5 @@
pub mod route;
pub mod agency;
pub mod stop;
pub mod route_stop;
pub mod stop_schedule;

View file

@ -1,4 +1,6 @@
#[derive(sqlx::Type, PartialEq, Debug, Clone)]
use serde::{Deserialize, Serialize};
#[derive(sqlx::Type, PartialEq, Debug, Clone, Serialize, Deserialize)]
#[sqlx(type_name = "septa_stop_type", rename_all = "snake_case")]
pub enum StopType {
FarSide,
@ -6,7 +8,7 @@ pub enum StopType {
Normal
}
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Stop {
pub id: i64,
pub name: String,

View file

@ -1,22 +1,19 @@
use serde::{Deserialize, Serialize};
use crate::direction::Direction;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StopSchedule {
pub route_id: String,
pub stop_name: String,
pub trip_id: String,
pub service_id: String,
pub direction_id: i64,
pub arrival_time: i64,
pub stop_id: i64,
pub stop_sequence: i64
pub stop_sequence: i64,
pub stop: crate::stop::Stop
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Trip {
pub route_id: String,
pub service_id: String,
pub trip_id: String,
pub direction_id: i64,
pub direction: Direction,
pub tracking_data: TripTracking,
pub schedule: Vec<StopSchedule>
}
@ -33,5 +30,5 @@ pub struct LiveTrip {
pub delay: f64,
pub next_stop_id: Option<String>,
pub timestamp: i64,
pub vehicle_id: Option<String>
pub vehicle_ids: Vec<String>
}