diff --git a/src/bin/read-syntus-fares.rs b/src/bin/read-syntus-fares.rs index 0d68630a9..bb667ef65 100644 --- a/src/bin/read-syntus-fares.rs +++ b/src/bin/read-syntus-fares.rs @@ -55,7 +55,7 @@ fn run() -> Result<()> { let model = transit_model::ntfs::read(opt.input)?; let (tickets, od_rules) = syntus_fares::read(opt.fares, &model.stop_points)?; let mut collections = model.into_collections(); - collections.tickets = tickets; + collections.tickets_v1 = tickets; collections.od_rules = od_rules; let model = transit_model::Model::new(collections)?; transit_model::ntfs::write(&model, opt.output, opt.current_datetime)?; diff --git a/src/model.rs b/src/model.rs index 9e59f7e14..408951036 100644 --- a/src/model.rs +++ b/src/model.rs @@ -54,7 +54,7 @@ pub struct Collections { pub trip_properties: CollectionWithId, pub geometries: CollectionWithId, #[serde(skip)] - pub tickets: Collection, + pub tickets_v1: Collection, #[serde(skip)] pub od_rules: Collection, pub admin_stations: Collection, @@ -88,7 +88,7 @@ impl Collections { transfers, trip_properties, geometries, - tickets, + tickets_v1, od_rules, admin_stations, stop_time_headsigns, @@ -96,7 +96,7 @@ impl Collections { stop_time_comments, .. } = c; - self.tickets.merge(tickets); + self.tickets_v1.merge(tickets_v1); self.od_rules.merge(od_rules); self.contributors.try_merge(contributors)?; self.datasets.try_merge(datasets)?; diff --git a/src/ntfs/mod.rs b/src/ntfs/mod.rs index b2a39b8b5..64cd58fe7 100644 --- a/src/ntfs/mod.rs +++ b/src/ntfs/mod.rs @@ -193,7 +193,7 @@ pub fn read>(path: P) -> Result { read::manage_codes(&mut collections, path)?; read::manage_comments(&mut collections, path)?; read::manage_object_properties(&mut collections, path)?; - read::manage_fares(&mut collections, path)?; + read::manage_fares_v1(&mut collections, path)?; info!("Indexing"); let res = Model::new(collections)?; info!("Loading NTFS done"); @@ -237,7 +237,7 @@ pub fn write>( write::write_comments(path, model)?; write::write_codes(path, model)?; write::write_object_properties(path, model)?; - write::write_fares(path, &model.tickets, &model.od_rules)?; + write::write_fares_v1(path, &model.tickets_v1, &model.od_rules)?; Ok(()) } diff --git a/src/ntfs/read.rs b/src/ntfs/read.rs index a3bbb2ee5..8bcb34c43 100644 --- a/src/ntfs/read.rs +++ b/src/ntfs/read.rs @@ -120,7 +120,7 @@ impl From for TicketV1 { } } -pub fn manage_fares(collections: &mut Collections, base_path: &path::Path) -> Result<()> { +pub fn manage_fares_v1(collections: &mut Collections, base_path: &path::Path) -> Result<()> { let file = "prices.csv"; if !base_path.join(file).exists() { info!("Skipping fares"); @@ -180,7 +180,7 @@ pub fn manage_fares(collections: &mut Collections, base_path: &path::Path) -> Re physical_mode_id: Some(physical_mode.to_string()), }); } - collections.tickets = Collection::new(tickets); + collections.tickets_v1 = Collection::new(tickets); collections.od_rules = Collection::new(od_rules); Ok(()) } diff --git a/src/ntfs/write.rs b/src/ntfs/write.rs index 933e72d1c..903d9dced 100644 --- a/src/ntfs/write.rs +++ b/src/ntfs/write.rs @@ -147,7 +147,7 @@ pub fn write_vehicle_journeys_and_stop_times( Ok(()) } -pub fn write_fares( +pub fn write_fares_v1( base_path: &path::Path, tickets: &Collection, od_rules: &Collection, diff --git a/src/objects.rs b/src/objects.rs index fc4bc7ed7..99cd046e8 100644 --- a/src/objects.rs +++ b/src/objects.rs @@ -1259,10 +1259,6 @@ pub struct AdminStation { } #[derive(Debug, Clone)] -#[deprecated( - since = "0.5.0", - note = "Ticketing model in NTFS v0.9 is a breaking change, look for the Ticket struct." -)] pub struct TicketV1 { pub id: String, pub start_date: NaiveDate, @@ -1275,10 +1271,6 @@ pub struct TicketV1 { impl_id!(TicketV1); #[derive(Debug, Clone)] -#[deprecated( - since = "0.5.0", - note = "Ticketing model in NTFS v0.9 is a breaking change, look for the Ticket struct." -)] pub struct ODRuleV1 { pub id: String, pub origin_stop_area_id: String, diff --git a/tests/read_syntus_fares.rs b/tests/read_syntus_fares.rs index 2860d4126..3f0780468 100644 --- a/tests/read_syntus_fares.rs +++ b/tests/read_syntus_fares.rs @@ -31,7 +31,7 @@ fn test_read_global() { ) .unwrap(); let mut collections = objects.into_collections(); - collections.tickets = tickets; + collections.tickets_v1 = tickets; collections.od_rules = od_rules; let new_model = Model::new(collections).unwrap(); transit_model::ntfs::write(&new_model, path, get_test_datetime()).unwrap();