Skip to content

Commit 4932d22

Browse files
committed
editoast: move SpeedSection to editoast_schemas
1 parent 9b4c70e commit 4932d22

File tree

14 files changed

+25
-21
lines changed

14 files changed

+25
-21
lines changed

editoast/editoast_schemas/src/infra.rs

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ mod neutral_section;
1111
mod side;
1212
mod sign;
1313
mod signal;
14+
mod speed_section;
1415
mod switch;
1516
mod switch_type;
1617
mod track_endpoint;
@@ -38,6 +39,8 @@ pub use signal::LogicalSignal;
3839
pub use signal::Signal;
3940
pub use signal::SignalExtensions;
4041
pub use signal::SignalSncfExtension;
42+
pub use speed_section::Speed;
43+
pub use speed_section::SpeedSection;
4144
pub use switch::Switch;
4245
pub use switch_type::builtin_node_types_list;
4346
pub use switch_type::Crossing;

editoast/src/schema/speed_section.rs editoast/editoast_schemas/src/infra/speed_section.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
use std::collections::HashMap;
22

33
use derivative::Derivative;
4+
use editoast_common::Identifier;
5+
use editoast_common::NonBlankString;
46
use serde::Deserialize;
57
use serde::Serialize;
68

7-
use super::OSRDIdentified;
8-
use super::ObjectType;
9-
use editoast_common::Identifier;
10-
use editoast_common::NonBlankString;
11-
use editoast_schemas::infra::ApplicableDirectionsTrackRange;
12-
use editoast_schemas::infra::Sign;
13-
use editoast_schemas::primitives::OSRDTyped;
9+
use super::ApplicableDirectionsTrackRange;
10+
use super::Sign;
11+
use crate::primitives::OSRDIdentified;
12+
use crate::primitives::OSRDTyped;
13+
use crate::primitives::ObjectType;
1414

1515
#[derive(Debug, Derivative, Clone, Serialize, PartialEq, Copy)]
1616
pub struct Speed(pub f64);

editoast/src/converters/utils.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ use editoast_schemas::infra::LogicalSignal;
88
use editoast_schemas::infra::Signal;
99
use editoast_schemas::infra::SignalExtensions;
1010
use editoast_schemas::infra::SignalSncfExtension;
11+
use editoast_schemas::infra::Speed;
12+
use editoast_schemas::infra::SpeedSection;
1113
use editoast_schemas::infra::Switch;
1214
use std::collections::HashMap;
1315
use std::str::FromStr;

editoast/src/generated_data/error/speed_sections.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ mod tests {
150150
use crate::infra_cache::tests::create_small_infra_cache;
151151
use crate::infra_cache::tests::create_speed_section_cache;
152152
use crate::infra_cache::Graph;
153-
use crate::schema::Speed;
153+
use editoast_schemas::infra::Speed;
154154
use editoast_schemas::primitives::ObjectRef;
155155
use editoast_schemas::primitives::ObjectType;
156156

editoast/src/infra_cache/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use editoast_schemas::infra::Endpoint;
2828
use editoast_schemas::infra::Link;
2929
use editoast_schemas::infra::PointSwitch;
3030
use editoast_schemas::infra::SingleSlipSwitch;
31+
use editoast_schemas::infra::SpeedSection;
3132
use editoast_schemas::infra::SwitchType;
3233
use editoast_schemas::infra::TrackEndpoint;
3334
use editoast_schemas::infra::Waypoint;
@@ -862,14 +863,14 @@ pub mod tests {
862863
use crate::modelsv2::infra::tests::test_infra_transaction;
863864
use crate::schema::OperationalPoint;
864865
use crate::schema::Route;
865-
use crate::schema::SpeedSection;
866866
use editoast_common::Identifier;
867867
use editoast_common::NonBlankString;
868868
use editoast_schemas::infra::ApplicableDirections;
869869
use editoast_schemas::infra::ApplicableDirectionsTrackRange;
870870
use editoast_schemas::infra::Direction;
871871
use editoast_schemas::infra::Electrification;
872872
use editoast_schemas::infra::Endpoint;
873+
use editoast_schemas::infra::SpeedSection;
873874
use editoast_schemas::infra::Switch;
874875
use editoast_schemas::infra::SwitchPortConnection;
875876
use editoast_schemas::infra::SwitchType;

editoast/src/infra_cache/object_cache/speed_section_cache.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::infra_cache::Cache;
22
use crate::infra_cache::ObjectCache;
3-
use crate::schema::SpeedSection;
3+
use editoast_schemas::infra::SpeedSection;
44

55
impl Cache for SpeedSection {
66
fn get_track_referenced_id(&self) -> Vec<&String> {

editoast/src/infra_cache/operation/create.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ use crate::error::Result;
1414
use crate::modelsv2::get_table;
1515
use crate::schema::OperationalPoint;
1616
use crate::schema::Route;
17-
use crate::schema::SpeedSection;
1817
use crate::schema::TrackSection;
1918
use editoast_schemas::infra::BufferStop;
2019
use editoast_schemas::infra::Detector;
2120
use editoast_schemas::infra::Electrification;
2221
use editoast_schemas::infra::NeutralSection;
2322
use editoast_schemas::infra::Signal;
23+
use editoast_schemas::infra::SpeedSection;
2424
use editoast_schemas::infra::Switch;
2525
use editoast_schemas::infra::SwitchType;
2626
use editoast_schemas::primitives::OSRDIdentified;
@@ -252,12 +252,12 @@ pub mod tests {
252252
use crate::modelsv2::infra::tests::test_infra_transaction;
253253
use crate::schema::OperationalPoint;
254254
use crate::schema::Route;
255-
use crate::schema::SpeedSection;
256255
use crate::schema::TrackSection;
257256
use editoast_schemas::infra::BufferStop;
258257
use editoast_schemas::infra::Detector;
259258
use editoast_schemas::infra::Electrification;
260259
use editoast_schemas::infra::Signal;
260+
use editoast_schemas::infra::SpeedSection;
261261
use editoast_schemas::infra::Switch;
262262
use editoast_schemas::infra::SwitchType;
263263

editoast/src/modelsv2/infra.rs

+1
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ pub mod tests {
251251
use editoast_schemas::infra::Electrification;
252252
use editoast_schemas::infra::NeutralSection;
253253
use editoast_schemas::infra::Signal;
254+
use editoast_schemas::infra::SpeedSection;
254255
use editoast_schemas::infra::Switch;
255256
use editoast_schemas::infra::SwitchType;
256257
use editoast_schemas::primitives::OSRDIdentified;

editoast/src/modelsv2/infra_objects.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ infra_model!(
189189
SpeedSectionModel,
190190
infra_object_speed_section,
191191
infra_layer_speed_section,
192-
schema::SpeedSection
192+
editoast_schemas::infra::SpeedSection
193193
);
194194

195195
infra_model!(

editoast/src/schema/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ mod errors;
22
pub mod operational_point;
33
mod railjson;
44
mod route;
5-
mod speed_section;
65
pub mod track_section;
76
pub mod utils;
87
pub mod v2;
@@ -19,8 +18,6 @@ pub use railjson::RailJson;
1918
pub use railjson::RAILJSON_VERSION;
2019
pub use route::Route;
2120
pub use route::RoutePath;
22-
pub use speed_section::Speed;
23-
pub use speed_section::SpeedSection;
2421
pub use track_section::TrackSection;
2522

2623
cfg_if! {

editoast/src/schema/railjson.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ use serde::Serialize;
44

55
use super::OperationalPoint;
66
use super::Route;
7-
use super::SpeedSection;
87
use super::TrackSection;
98
use editoast_schemas::infra::BufferStop;
109
use editoast_schemas::infra::Detector;
1110
use editoast_schemas::infra::Electrification;
1211
use editoast_schemas::infra::NeutralSection;
1312
use editoast_schemas::infra::Signal;
13+
use editoast_schemas::infra::SpeedSection;
1414
use editoast_schemas::infra::Switch;
1515
use editoast_schemas::infra::SwitchType;
1616

editoast/src/views/infra/auto_fixes/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ mod tests {
342342
use crate::schema::OperationalPointPart;
343343
use crate::schema::Route;
344344
use crate::schema::Slope;
345-
use crate::schema::SpeedSection;
346345
use crate::schema::TrackSection;
347346
use crate::views::pagination::PaginatedResponse;
348347
use crate::views::tests::create_test_service;
@@ -352,6 +351,7 @@ mod tests {
352351
use editoast_schemas::infra::Electrification;
353352
use editoast_schemas::infra::Endpoint;
354353
use editoast_schemas::infra::Signal;
354+
use editoast_schemas::infra::SpeedSection;
355355
use editoast_schemas::infra::Switch;
356356
use editoast_schemas::infra::TrackEndpoint;
357357
use editoast_schemas::infra::Waypoint;

editoast/src/views/infra/auto_fixes/speed_section.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::infra_cache::operation::RailjsonObject;
1616
use crate::infra_cache::operation::UpdateOperation;
1717
use crate::schema::InfraError;
1818
use crate::schema::InfraErrorType;
19-
use crate::schema::SpeedSection;
19+
use editoast_schemas::infra::SpeedSection;
2020
use editoast_schemas::primitives::OSRDIdentified as _;
2121
use editoast_schemas::primitives::OSRDObject as _;
2222
use editoast_schemas::primitives::ObjectRef;
@@ -95,10 +95,10 @@ mod tests {
9595
use crate::infra_cache::operation::Operation;
9696
use crate::infra_cache::ObjectCache;
9797
use crate::schema::InfraError;
98-
use crate::schema::SpeedSection;
9998
use editoast_common::Identifier;
10099
use editoast_schemas::infra::ApplicableDirections;
101100
use editoast_schemas::infra::ApplicableDirectionsTrackRange;
101+
use editoast_schemas::infra::SpeedSection;
102102
use editoast_schemas::primitives::OSRDObject as _;
103103
use editoast_schemas::primitives::ObjectRef;
104104
use editoast_schemas::primitives::ObjectType;

editoast/src/views/infra/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -571,11 +571,11 @@ pub mod tests {
571571
use crate::modelsv2::get_geometry_layer_table;
572572
use crate::modelsv2::get_table;
573573
use crate::modelsv2::infra::DEFAULT_INFRA_VERSION;
574-
use crate::schema::SpeedSection;
575574
use crate::schema::RAILJSON_VERSION;
576575
use crate::views::tests::create_test_service;
577576
use crate::views::tests::create_test_service_with_core_client;
578577
use editoast_schemas::infra::Electrification;
578+
use editoast_schemas::infra::SpeedSection;
579579
use editoast_schemas::infra::SwitchType;
580580
use editoast_schemas::primitives::ObjectType;
581581

0 commit comments

Comments
 (0)