1- use std:: str:: FromStr ;
2-
3- use chrono:: DateTime ;
41use chrono:: Duration as ChronoDuration ;
52use chrono:: Utc ;
63use database:: DbConnection ;
@@ -25,35 +22,13 @@ use schemas::fixtures::simple_created_exception_with_change_groups;
2522use schemas:: fixtures:: simple_modified_exception_with_change_groups;
2623use schemas:: infra:: InfraObject ;
2724use schemas:: infra:: RailJson ;
28- use schemas:: infra:: TrackOffset ;
29- use schemas:: paced_train:: ConstraintDistributionChangeGroup ;
3025use schemas:: paced_train:: ExceptionType ;
31- use schemas:: paced_train:: InitialSpeedChangeGroup ;
32- use schemas:: paced_train:: LabelsChangeGroup ;
33- use schemas:: paced_train:: OptionsChangeGroup ;
3426use schemas:: paced_train:: Paced ;
3527use schemas:: paced_train:: PacedTrainException ;
36- use schemas:: paced_train:: PathAndScheduleChangeGroup ;
37- use schemas:: paced_train:: RollingStockCategoryChangeGroup ;
38- use schemas:: paced_train:: RollingStockChangeGroup ;
39- use schemas:: paced_train:: SpeedLimitTagChangeGroup ;
40- use schemas:: paced_train:: StartTimeChangeGroup ;
4128use schemas:: paced_train:: TrainNameChangeGroup ;
4229use schemas:: paced_train:: TrainSchedule ;
43- use schemas:: primitives:: Identifier ;
44- use schemas:: primitives:: NonBlankString ;
4530use schemas:: primitives:: OSRDObject ;
4631use schemas:: rolling_stock:: SubCategoryColor ;
47- use schemas:: train_schedule:: Comfort ;
48- use schemas:: train_schedule:: Distribution ;
49- use schemas:: train_schedule:: MarginValue ;
50- use schemas:: train_schedule:: Margins ;
51- use schemas:: train_schedule:: OperationalPointPartReference ;
52- use schemas:: train_schedule:: OperationalPointReference ;
53- use schemas:: train_schedule:: PathItem ;
54- use schemas:: train_schedule:: PathItemLocation ;
55- use schemas:: train_schedule:: ScheduleItem ;
56- use schemas:: train_schedule:: TrainScheduleOptions ;
5732
5833use crate :: infra_cache:: operation:: create:: apply_create_operation;
5934use crate :: models;
@@ -139,91 +114,7 @@ pub fn create_created_exception_with_change_groups(key: &str) -> PacedTrainExcep
139114 key : key. into ( ) ,
140115 exception_type : ExceptionType :: Created { } ,
141116 disabled : false ,
142- change_groups : TrainScheduleExceptionChangeGroups {
143- train_name : Some ( TrainNameChangeGroup {
144- value : "created_exception_train_name" . into ( ) ,
145- } ) ,
146- constraint_distribution : Some ( ConstraintDistributionChangeGroup {
147- value : Distribution :: Mareco ,
148- } ) ,
149- initial_speed : Some ( InitialSpeedChangeGroup { value : 10.0 } ) ,
150- labels : Some ( LabelsChangeGroup {
151- value : vec ! [ "Label 1" . to_string( ) , "Label 3" . to_string( ) ] ,
152- } ) ,
153- options : Some ( OptionsChangeGroup {
154- value : TrainScheduleOptions :: default ( ) ,
155- } ) ,
156- path_and_schedule : Some ( PathAndScheduleChangeGroup {
157- power_restrictions : vec ! [ ] ,
158- schedule : vec ! [
159- ScheduleItem {
160- at: NonBlankString ( "aa" . to_string( ) ) ,
161- ..Default :: default ( )
162- } ,
163- ScheduleItem {
164- at: NonBlankString ( "bb" . to_string( ) ) ,
165- ..Default :: default ( )
166- } ,
167- ScheduleItem {
168- at: NonBlankString ( "cc" . to_string( ) ) ,
169- ..Default :: default ( )
170- } ,
171- ScheduleItem {
172- at: NonBlankString ( "dd" . to_string( ) ) ,
173- ..Default :: default ( )
174- } ,
175- ] ,
176- path : vec ! [
177- PathItem {
178- id: "aa" . into( ) ,
179- location: PathItemLocation :: TrackOffset ( TrackOffset {
180- offset: 300 ,
181- track: Identifier ( "TC0" . to_string( ) ) ,
182- } ) ,
183- } ,
184- PathItem {
185- id: "bb" . into( ) ,
186- location: PathItemLocation :: OperationalPointPartReference (
187- OperationalPointPartReference {
188- operational_point: OperationalPointReference :: Id {
189- operational_point: Identifier ( "Mid_East_station" . to_string( ) ) ,
190- } ,
191- local_track_name: None ,
192- } ,
193- ) ,
194- } ,
195- PathItem {
196- id: "cc" . into( ) ,
197- location: PathItemLocation :: TrackOffset ( TrackOffset {
198- offset: 300 ,
199- track: Identifier ( "TC1" . to_string( ) ) ,
200- } ) ,
201- } ,
202- PathItem {
203- id: "dd" . into( ) ,
204- location: PathItemLocation :: TrackOffset ( TrackOffset {
205- offset: 300 ,
206- track: Identifier ( "TC2" . to_string( ) ) ,
207- } ) ,
208- } ,
209- ] ,
210- margins : Margins {
211- boundaries : vec ! [ ] ,
212- values : vec ! [ MarginValue :: Percentage ( 5.0 ) ] ,
213- } ,
214- } ) ,
215- rolling_stock : Some ( RollingStockChangeGroup {
216- rolling_stock_name : "simulation_rolling_stock" . into ( ) ,
217- comfort : Comfort :: AirConditioning ,
218- } ) ,
219- rolling_stock_category : Some ( RollingStockCategoryChangeGroup { value : None } ) ,
220- speed_limit_tag : Some ( SpeedLimitTagChangeGroup {
221- value : Some ( NonBlankString ( "GB" . into ( ) ) ) ,
222- } ) ,
223- start_time : Some ( StartTimeChangeGroup {
224- value : DateTime :: < Utc > :: from_str ( "2025-05-15T15:10:00+02:00" ) . unwrap ( ) ,
225- } ) ,
226- } ,
117+ change_groups : TrainScheduleExceptionChangeGroups :: fake_created ( ) ,
227118 }
228119}
229120
0 commit comments