Skip to content

Commit 51dd1a4

Browse files
committed
editoast: move Route to editoast_schemas
1 parent 4932d22 commit 51dd1a4

File tree

13 files changed

+27
-19
lines changed

13 files changed

+27
-19
lines changed

editoast/editoast_schemas/src/infra.rs

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ mod electrical_profiles;
88
mod electrification;
99
mod endpoint;
1010
mod neutral_section;
11+
mod route;
1112
mod side;
1213
mod sign;
1314
mod signal;
@@ -33,6 +34,8 @@ pub use electrical_profiles::LevelValues;
3334
pub use electrification::Electrification;
3435
pub use endpoint::Endpoint;
3536
pub use neutral_section::NeutralSection;
37+
pub use route::Route;
38+
pub use route::RoutePath;
3639
pub use side::Side;
3740
pub use sign::Sign;
3841
pub use signal::LogicalSignal;

editoast/src/schema/route.rs editoast/editoast_schemas/src/infra/route.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;
45
use serde::Deserialize;
56
use serde::Serialize;
67

7-
use super::OSRDIdentified;
8-
use super::ObjectType;
9-
use editoast_common::Identifier;
10-
use editoast_schemas::infra::Direction;
11-
use editoast_schemas::infra::DirectionalTrackRange;
12-
use editoast_schemas::infra::Waypoint;
13-
use editoast_schemas::primitives::OSRDTyped;
8+
use super::Direction;
9+
use super::DirectionalTrackRange;
10+
use super::Waypoint;
11+
use crate::primitives::OSRDIdentified;
12+
use crate::primitives::OSRDTyped;
13+
use crate::primitives::ObjectType;
1414

1515
#[derive(Debug, Derivative, Clone, Deserialize, Serialize, PartialEq, Eq)]
1616
#[serde(deny_unknown_fields)]

editoast/src/converters/generate_routes.rs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use editoast_common::Identifier;
1111
use editoast_schemas::infra::builtin_node_types_list;
1212
use editoast_schemas::infra::Direction;
1313
use editoast_schemas::infra::Endpoint;
14+
use editoast_schemas::infra::Route;
1415
use editoast_schemas::infra::TrackEndpoint;
1516
use editoast_schemas::infra::Waypoint;
1617
use editoast_schemas::primitives::OSRDIdentified;

editoast/src/infra_cache/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ use editoast_schemas::infra::Electrification;
2727
use editoast_schemas::infra::Endpoint;
2828
use editoast_schemas::infra::Link;
2929
use editoast_schemas::infra::PointSwitch;
30+
use editoast_schemas::infra::Route;
31+
use editoast_schemas::infra::RoutePath;
3032
use editoast_schemas::infra::SingleSlipSwitch;
3133
use editoast_schemas::infra::SpeedSection;
3234
use editoast_schemas::infra::SwitchType;
@@ -862,14 +864,14 @@ pub mod tests {
862864
use crate::map::BoundingBox;
863865
use crate::modelsv2::infra::tests::test_infra_transaction;
864866
use crate::schema::OperationalPoint;
865-
use crate::schema::Route;
866867
use editoast_common::Identifier;
867868
use editoast_common::NonBlankString;
868869
use editoast_schemas::infra::ApplicableDirections;
869870
use editoast_schemas::infra::ApplicableDirectionsTrackRange;
870871
use editoast_schemas::infra::Direction;
871872
use editoast_schemas::infra::Electrification;
872873
use editoast_schemas::infra::Endpoint;
874+
use editoast_schemas::infra::Route;
873875
use editoast_schemas::infra::SpeedSection;
874876
use editoast_schemas::infra::Switch;
875877
use editoast_schemas::infra::SwitchPortConnection;

editoast/src/infra_cache/object_cache/route_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::Route;
3+
use editoast_schemas::infra::Route;
44

55
impl Cache for Route {
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
@@ -13,12 +13,12 @@ use super::OperationError;
1313
use crate::error::Result;
1414
use crate::modelsv2::get_table;
1515
use crate::schema::OperationalPoint;
16-
use crate::schema::Route;
1716
use crate::schema::TrackSection;
1817
use editoast_schemas::infra::BufferStop;
1918
use editoast_schemas::infra::Detector;
2019
use editoast_schemas::infra::Electrification;
2120
use editoast_schemas::infra::NeutralSection;
21+
use editoast_schemas::infra::Route;
2222
use editoast_schemas::infra::Signal;
2323
use editoast_schemas::infra::SpeedSection;
2424
use editoast_schemas::infra::Switch;
@@ -251,11 +251,11 @@ pub mod tests {
251251
use crate::infra_cache::operation::create::RailjsonObject;
252252
use crate::modelsv2::infra::tests::test_infra_transaction;
253253
use crate::schema::OperationalPoint;
254-
use crate::schema::Route;
255254
use crate::schema::TrackSection;
256255
use editoast_schemas::infra::BufferStop;
257256
use editoast_schemas::infra::Detector;
258257
use editoast_schemas::infra::Electrification;
258+
use editoast_schemas::infra::Route;
259259
use editoast_schemas::infra::Signal;
260260
use editoast_schemas::infra::SpeedSection;
261261
use editoast_schemas::infra::Switch;

editoast/src/modelsv2/infra.rs

+1
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ pub mod tests {
250250
use editoast_schemas::infra::Detector;
251251
use editoast_schemas::infra::Electrification;
252252
use editoast_schemas::infra::NeutralSection;
253+
use editoast_schemas::infra::Route;
253254
use editoast_schemas::infra::Signal;
254255
use editoast_schemas::infra::SpeedSection;
255256
use editoast_schemas::infra::Switch;

editoast/src/modelsv2/infra_objects.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,11 @@ infra_model!(
169169
schema::OperationalPoint
170170
);
171171

172-
infra_model!(RouteModel, infra_object_route, schema::Route);
172+
infra_model!(
173+
RouteModel,
174+
infra_object_route,
175+
editoast_schemas::infra::Route
176+
);
173177

174178
infra_model!(
175179
SignalModel,

editoast/src/schema/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
mod errors;
22
pub mod operational_point;
33
mod railjson;
4-
mod route;
54
pub mod track_section;
65
pub mod utils;
76
pub mod v2;
@@ -16,8 +15,6 @@ pub use operational_point::OperationalPointIdentifierExtension;
1615
pub use operational_point::OperationalPointPart;
1716
pub use railjson::RailJson;
1817
pub use railjson::RAILJSON_VERSION;
19-
pub use route::Route;
20-
pub use route::RoutePath;
2118
pub use track_section::TrackSection;
2219

2320
cfg_if! {

editoast/src/schema/railjson.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ use serde::Deserialize;
33
use serde::Serialize;
44

55
use super::OperationalPoint;
6-
use super::Route;
76
use super::TrackSection;
87
use editoast_schemas::infra::BufferStop;
98
use editoast_schemas::infra::Detector;
109
use editoast_schemas::infra::Electrification;
1110
use editoast_schemas::infra::NeutralSection;
11+
use editoast_schemas::infra::Route;
1212
use editoast_schemas::infra::Signal;
1313
use editoast_schemas::infra::SpeedSection;
1414
use editoast_schemas::infra::Switch;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ mod tests {
340340
use crate::infra_cache::InfraCacheEditoastError;
341341
use crate::schema::OperationalPoint;
342342
use crate::schema::OperationalPointPart;
343-
use crate::schema::Route;
344343
use crate::schema::Slope;
345344
use crate::schema::TrackSection;
346345
use crate::views::pagination::PaginatedResponse;
@@ -350,6 +349,7 @@ mod tests {
350349
use editoast_schemas::infra::Detector;
351350
use editoast_schemas::infra::Electrification;
352351
use editoast_schemas::infra::Endpoint;
352+
use editoast_schemas::infra::Route;
353353
use editoast_schemas::infra::Signal;
354354
use editoast_schemas::infra::SpeedSection;
355355
use editoast_schemas::infra::Switch;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use super::new_ref_fix_delete_pair;
66
use super::Fix;
77
use crate::schema::InfraError;
88
use crate::schema::InfraErrorType;
9-
use crate::schema::Route;
9+
use editoast_schemas::infra::Route;
1010
use editoast_schemas::primitives::OSRDIdentified as _;
1111
use editoast_schemas::primitives::OSRDObject as _;
1212
use editoast_schemas::primitives::ObjectRef;

editoast/src/views/infra/routes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,13 @@ mod tests {
237237
use crate::fixtures::tests::empty_infra;
238238
use crate::fixtures::tests::small_infra;
239239
use crate::infra_cache::operation::Operation;
240-
use crate::schema::Route;
241240
use crate::schema::TrackSection;
242241
use crate::views::infra::routes::RoutesResponse;
243242
use crate::views::infra::routes::WaypointType;
244243
use crate::views::tests::create_test_service;
245244
use editoast_schemas::infra::BufferStop;
246245
use editoast_schemas::infra::Detector;
246+
use editoast_schemas::infra::Route;
247247
use editoast_schemas::infra::Waypoint;
248248

249249
#[rstest]

0 commit comments

Comments
 (0)