diff --git a/editoast/editoast_schemas/src/rolling_stock/mod.rs b/editoast/editoast_schemas/src/rolling_stock/mod.rs index 70190543bbe..b69ceb9dfd7 100644 --- a/editoast/editoast_schemas/src/rolling_stock/mod.rs +++ b/editoast/editoast_schemas/src/rolling_stock/mod.rs @@ -27,15 +27,13 @@ pub use rolling_stock_metadata::RollingStockMetadata; mod loading_gauge_type; pub use loading_gauge_type::LoadingGaugeType; -mod rolling_stock_common; -pub use rolling_stock_common::RollingStockCommon; - mod rolling_stock_livery; pub use rolling_stock_livery::RollingStockLivery; pub use rolling_stock_livery::RollingStockLiveryMetadata; use serde::Deserialize; use serde::Serialize; +use std::collections::HashMap; use utoipa::ToSchema; editoast_common::schemas! { @@ -55,7 +53,6 @@ editoast_common::schemas! { RollingStockSupportedSignalingSystems, RollingStockMetadata, LoadingGaugeType, - RollingStockCommon, RollingStockLivery, RollingStockLiveryMetadata, } @@ -65,8 +62,33 @@ pub const ROLLING_STOCK_RAILJSON_VERSION: &str = "3.2"; #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, ToSchema)] pub struct RollingStock { pub id: i64, - #[serde(flatten)] - pub common: RollingStockCommon, + pub name: String, + pub effort_curves: EffortCurves, + #[schema(example = "5", required)] + pub base_power_class: Option, + pub length: f64, + pub max_speed: f64, + pub startup_time: f64, + pub startup_acceleration: f64, + pub comfort_acceleration: f64, + pub gamma: Gamma, + pub inertia_coefficient: f64, + pub mass: f64, + pub rolling_resistance: RollingResistance, + pub loading_gauge: LoadingGaugeType, + /// Mapping of power restriction code to power class + #[serde(default)] + #[schema(required)] + pub power_restrictions: HashMap, + #[serde(default)] + pub energy_sources: Vec, + /// The time the train takes before actually using electrical power (in seconds). Is null if the train is not electric. + #[schema(example = 5.0)] + pub electrical_power_startup_time: Option, + /// The time it takes to raise this train's pantograph in seconds. Is null if the train is not electric. + #[schema(example = 15.0)] + pub raise_pantograph_time: Option, + pub supported_signaling_systems: RollingStockSupportedSignalingSystems, pub railjson_version: String, /// Whether the rolling stock can be edited/deleted or not. pub locked: bool, diff --git a/editoast/editoast_schemas/src/rolling_stock/rolling_stock_common.rs b/editoast/editoast_schemas/src/rolling_stock/rolling_stock_common.rs deleted file mode 100644 index 28eff2c8f0e..00000000000 --- a/editoast/editoast_schemas/src/rolling_stock/rolling_stock_common.rs +++ /dev/null @@ -1,45 +0,0 @@ -use std::collections::HashMap; - -use derivative::Derivative; -use serde::Deserialize; -use serde::Serialize; -use utoipa::ToSchema; - -use super::EffortCurves; -use super::EnergySource; -use super::Gamma; -use super::LoadingGaugeType; -use super::RollingResistance; -use super::RollingStockSupportedSignalingSystems; - -#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, Derivative)] -#[derivative(PartialEq)] -pub struct RollingStockCommon { - pub name: String, - pub effort_curves: EffortCurves, - #[schema(example = "5", required)] - pub base_power_class: Option, - pub length: f64, - pub max_speed: f64, - pub startup_time: f64, - pub startup_acceleration: f64, - pub comfort_acceleration: f64, - pub gamma: Gamma, - pub inertia_coefficient: f64, - pub mass: f64, - pub rolling_resistance: RollingResistance, - pub loading_gauge: LoadingGaugeType, - /// Mapping of power restriction code to power class - #[serde(default)] - #[schema(required)] - pub power_restrictions: HashMap, - #[serde(default)] - pub energy_sources: Vec, - /// The time the train takes before actually using electrical power (in seconds). Is null if the train is not electric. - #[schema(example = 5.0)] - pub electrical_power_startup_time: Option, - /// The time it takes to raise this train's pantograph in seconds. Is null if the train is not electric. - #[schema(example = 15.0)] - pub raise_pantograph_time: Option, - pub supported_signaling_systems: RollingStockSupportedSignalingSystems, -} diff --git a/editoast/openapi.yaml b/editoast/openapi.yaml index c0d9a888c78..76577ef9c86 100644 --- a/editoast/openapi.yaml +++ b/editoast/openapi.yaml @@ -5111,33 +5111,6 @@ components: - C type: object RollingStock: - allOf: - - $ref: '#/components/schemas/RollingStockCommon' - - properties: - id: - format: int64 - type: integer - locked: - description: Whether the rolling stock can be edited/deleted or not. - type: boolean - metadata: - $ref: '#/components/schemas/RollingStockMetadata' - railjson_version: - type: string - required: - - id - - railjson_version - - locked - - metadata - type: object - RollingStockComfortType: - description: Train comfort that will be used for the simulation - enum: - - STANDARD - - AC - - HEATING - type: string - RollingStockCommon: properties: base_power_class: example: '5' @@ -5160,6 +5133,9 @@ components: type: array gamma: $ref: '#/components/schemas/Gamma' + id: + format: int64 + type: integer inertia_coefficient: format: double type: number @@ -5168,12 +5144,17 @@ components: type: number loading_gauge: $ref: '#/components/schemas/LoadingGaugeType' + locked: + description: Whether the rolling stock can be edited/deleted or not. + type: boolean mass: format: double type: number max_speed: format: double type: number + metadata: + $ref: '#/components/schemas/RollingStockMetadata' name: type: string power_restrictions: @@ -5181,6 +5162,8 @@ components: type: string description: Mapping of power restriction code to power class type: object + railjson_version: + type: string raise_pantograph_time: description: The time it takes to raise this train's pantograph in seconds. Is null if the train is not electric. example: 15.0 @@ -5198,6 +5181,7 @@ components: supported_signaling_systems: $ref: '#/components/schemas/RollingStockSupportedSignalingSystems' required: + - id - name - effort_curves - base_power_class @@ -5213,7 +5197,17 @@ components: - loading_gauge - power_restrictions - supported_signaling_systems + - railjson_version + - locked + - metadata type: object + RollingStockComfortType: + description: Train comfort that will be used for the simulation + enum: + - STANDARD + - AC + - HEATING + type: string RollingStockError: oneOf: - enum: @@ -5278,17 +5272,88 @@ components: - BasePowerClassEmpty type: string RollingStockForm: - allOf: - - $ref: '#/components/schemas/RollingStockCommon' - - properties: - locked: - nullable: true - type: boolean - metadata: - $ref: '#/components/schemas/RollingStockMetadata' - required: - - metadata - type: object + properties: + base_power_class: + example: '5' + nullable: true + type: string + comfort_acceleration: + format: double + type: number + effort_curves: + $ref: '#/components/schemas/EffortCurves' + electrical_power_startup_time: + description: The time the train takes before actually using electrical power (in seconds). Is null if the train is not electric. + example: 5.0 + format: double + nullable: true + type: number + energy_sources: + items: + $ref: '#/components/schemas/EnergySource' + type: array + gamma: + $ref: '#/components/schemas/Gamma' + inertia_coefficient: + format: double + type: number + length: + format: double + type: number + loading_gauge: + $ref: '#/components/schemas/LoadingGaugeType' + locked: + nullable: true + type: boolean + mass: + format: double + type: number + max_speed: + format: double + type: number + metadata: + $ref: '#/components/schemas/RollingStockMetadata' + name: + type: string + power_restrictions: + additionalProperties: + type: string + description: Mapping of power restriction code to power class + type: object + raise_pantograph_time: + description: The time it takes to raise this train's pantograph in seconds. Is null if the train is not electric. + example: 15.0 + format: double + nullable: true + type: number + rolling_resistance: + $ref: '#/components/schemas/RollingResistance' + startup_acceleration: + format: double + type: number + startup_time: + format: double + type: number + supported_signaling_systems: + $ref: '#/components/schemas/RollingStockSupportedSignalingSystems' + required: + - name + - effort_curves + - base_power_class + - length + - max_speed + - startup_time + - startup_acceleration + - comfort_acceleration + - gamma + - inertia_coefficient + - mass + - rolling_resistance + - loading_gauge + - power_restrictions + - supported_signaling_systems + - metadata + type: object RollingStockLivery: properties: compound_image_id: diff --git a/editoast/src/fixtures.rs b/editoast/src/fixtures.rs index a49abcfb6f8..60feb17649e 100644 --- a/editoast/src/fixtures.rs +++ b/editoast/src/fixtures.rs @@ -154,7 +154,7 @@ pub mod tests { let mut rolling_stock_form: RollingStockForm = serde_json::from_str(include_str!("./tests/example_rolling_stock_1.json")) .expect("Unable to parse"); - rolling_stock_form.common.name = name.to_string(); + rolling_stock_form.name = name.to_string(); rolling_stock_form } @@ -172,7 +172,7 @@ pub mod tests { "./tests/example_rolling_stock_2_energy_sources.json" )) .expect("Unable to parse"); - rolling_stock_form.common.name = name.to_string(); + rolling_stock_form.name = name.to_string(); rolling_stock_form } diff --git a/editoast/src/models/rolling_stock/mod.rs b/editoast/src/models/rolling_stock/mod.rs index a5706585ad2..f853205e0c4 100644 --- a/editoast/src/models/rolling_stock/mod.rs +++ b/editoast/src/models/rolling_stock/mod.rs @@ -1,10 +1,14 @@ -use editoast_schemas::rolling_stock::{RollingStock, RollingStockCommon}; +use editoast_schemas::rolling_stock::RollingStock; use crate::modelsv2::rolling_stock_model::RollingStockModel; -impl From for RollingStockCommon { +impl From for RollingStock { fn from(rolling_stock_model: RollingStockModel) -> Self { - RollingStockCommon { + RollingStock { + railjson_version: rolling_stock_model.railjson_version, + id: rolling_stock_model.id, + metadata: rolling_stock_model.metadata, + locked: rolling_stock_model.locked, name: rolling_stock_model.name, effort_curves: rolling_stock_model.effort_curves, base_power_class: rolling_stock_model.base_power_class, @@ -27,19 +31,6 @@ impl From for RollingStockCommon { } } -impl From for RollingStock { - fn from(rolling_stock_model: RollingStockModel) -> Self { - let rolling_stock_common: RollingStockCommon = rolling_stock_model.clone().into(); - RollingStock { - id: rolling_stock_model.id, - common: rolling_stock_common, - railjson_version: rolling_stock_model.railjson_version, - locked: rolling_stock_model.locked, - metadata: rolling_stock_model.metadata, - } - } -} - #[cfg(test)] pub mod tests { use actix_web::web::Data; diff --git a/editoast/src/views/rolling_stocks/mod.rs b/editoast/src/views/rolling_stocks/mod.rs index 72d2fe17dc6..cdaba143fc8 100644 --- a/editoast/src/views/rolling_stocks/mod.rs +++ b/editoast/src/views/rolling_stocks/mod.rs @@ -204,7 +204,7 @@ async fn create( ) -> Result> { rolling_stock_form.validate()?; let mut db_conn = db_pool.get().await?; - let rolling_stock_name = rolling_stock_form.common.name.clone(); + let rolling_stock_name = rolling_stock_form.name.clone(); let rolling_stock_changeset: Changeset = rolling_stock_form.into(); let rolling_stock = rolling_stock_changeset @@ -247,7 +247,7 @@ async fn update( let existing_rs_version = existing_rs.version; assert_rolling_stock_unlocked(existing_rs.clone())?; - let rolling_stock_name = rolling_stock_form.common.name.clone(); + let rolling_stock_name = rolling_stock_form.name.clone(); let existing_rs_form: RollingStockForm = existing_rs.into(); @@ -606,7 +606,7 @@ pub mod tests { // THEN let response_body: RollingStock = assert_status_and_read!(response, StatusCode::OK); - assert_eq!(response_body.common.name, name); + assert_eq!(response_body.name, name); } #[rstest] @@ -644,27 +644,27 @@ pub mod tests { let response_body = RollingStockModel::changeset() .railjson_version(response_body.railjson_version) - .name(response_body.common.name) - .effort_curves(response_body.common.effort_curves) + .name(response_body.name) + .effort_curves(response_body.effort_curves) .metadata(response_body.metadata) - .length(response_body.common.length) - .max_speed(response_body.common.max_speed) - .startup_time(response_body.common.startup_time) - .startup_acceleration(response_body.common.startup_acceleration) - .comfort_acceleration(response_body.common.comfort_acceleration) - .gamma(response_body.common.gamma) - .inertia_coefficient(response_body.common.inertia_coefficient) - .base_power_class(response_body.common.base_power_class) - .mass(response_body.common.mass) - .rolling_resistance(response_body.common.rolling_resistance) - .loading_gauge(response_body.common.loading_gauge) - .power_restrictions(response_body.common.power_restrictions) - .energy_sources(response_body.common.energy_sources) - .electrical_power_startup_time(response_body.common.electrical_power_startup_time) - .raise_pantograph_time(response_body.common.raise_pantograph_time) - .supported_signaling_systems(response_body.common.supported_signaling_systems); - - assert_eq!(response_body.name, Some(rolling_stock_form.common.name)); + .length(response_body.length) + .max_speed(response_body.max_speed) + .startup_time(response_body.startup_time) + .startup_acceleration(response_body.startup_acceleration) + .comfort_acceleration(response_body.comfort_acceleration) + .gamma(response_body.gamma) + .inertia_coefficient(response_body.inertia_coefficient) + .base_power_class(response_body.base_power_class) + .mass(response_body.mass) + .rolling_resistance(response_body.rolling_resistance) + .loading_gauge(response_body.loading_gauge) + .power_restrictions(response_body.power_restrictions) + .energy_sources(response_body.energy_sources) + .electrical_power_startup_time(response_body.electrical_power_startup_time) + .raise_pantograph_time(response_body.raise_pantograph_time) + .supported_signaling_systems(response_body.supported_signaling_systems); + + assert_eq!(response_body.name, Some(rolling_stock_form.name)); // Check rolling_stock deletion let delete_request = rolling_stock_delete_request(rolling_stock_id); @@ -704,7 +704,7 @@ pub mod tests { let mut rolling_stock_form = get_fast_rolling_stock_form( "fast_rolling_stock_create_rolling_stock_with_base_power_class_empty", ); - rolling_stock_form.common.base_power_class = Some("".to_string()); + rolling_stock_form.base_power_class = Some("".to_string()); // WHEN let post_response = call_service( @@ -727,7 +727,7 @@ pub mod tests { let fast_rolling_stock = named_fast_rolling_stock(name, db_pool.clone()).await; let app = create_test_service().await; let mut rolling_stock_form = get_fast_rolling_stock_form(name); - rolling_stock_form.common.name = fast_rolling_stock.model.name.clone(); + rolling_stock_form.name = fast_rolling_stock.model.name.clone(); // WHEN let post_response = call_service( @@ -859,7 +859,7 @@ pub mod tests { let rolling_stock_id = fast_rolling_stock.id(); let mut rolling_stock_form: RollingStockForm = fast_rolling_stock.model.clone().into(); - rolling_stock_form.common.name = + rolling_stock_form.name = "other_rolling_stock_update_unlocked_rolling_stock".to_string(); // WHEN diff --git a/editoast/src/views/rolling_stocks/rolling_stock_form.rs b/editoast/src/views/rolling_stocks/rolling_stock_form.rs index e09e545b020..2749b6186c5 100644 --- a/editoast/src/views/rolling_stocks/rolling_stock_form.rs +++ b/editoast/src/views/rolling_stocks/rolling_stock_form.rs @@ -1,6 +1,13 @@ +use std::collections::HashMap; + use derivative::Derivative; -use editoast_schemas::rolling_stock::RollingStockCommon; +use editoast_schemas::rolling_stock::EffortCurves; +use editoast_schemas::rolling_stock::EnergySource; +use editoast_schemas::rolling_stock::Gamma; +use editoast_schemas::rolling_stock::LoadingGaugeType; +use editoast_schemas::rolling_stock::RollingResistance; use editoast_schemas::rolling_stock::RollingStockMetadata; +use editoast_schemas::rolling_stock::RollingStockSupportedSignalingSystems; use editoast_schemas::rolling_stock::ROLLING_STOCK_RAILJSON_VERSION; use serde_derive::Deserialize; use serde_derive::Serialize; @@ -17,8 +24,33 @@ use crate::modelsv2::RollingStockModel; #[derivative(PartialEq)] #[validate(schema(function = "validate_rolling_stock_form"))] pub struct RollingStockForm { - #[serde(flatten)] - pub common: RollingStockCommon, + pub name: String, + pub effort_curves: EffortCurves, + #[schema(example = "5", required)] + pub base_power_class: Option, + pub length: f64, + pub max_speed: f64, + pub startup_time: f64, + pub startup_acceleration: f64, + pub comfort_acceleration: f64, + pub gamma: Gamma, + pub inertia_coefficient: f64, + pub mass: f64, + pub rolling_resistance: RollingResistance, + pub loading_gauge: LoadingGaugeType, + /// Mapping of power restriction code to power class + #[serde(default)] + #[schema(required)] + pub power_restrictions: HashMap, + #[serde(default)] + pub energy_sources: Vec, + /// The time the train takes before actually using electrical power (in seconds). Is null if the train is not electric. + #[schema(example = 5.0)] + pub electrical_power_startup_time: Option, + /// The time it takes to raise this train's pantograph in seconds. Is null if the train is not electric. + #[schema(example = 15.0)] + pub raise_pantograph_time: Option, + pub supported_signaling_systems: RollingStockSupportedSignalingSystems, #[derivative(PartialEq = "ignore")] pub locked: Option, #[derivative(PartialEq = "ignore")] @@ -28,26 +60,24 @@ pub struct RollingStockForm { impl From for RollingStockForm { fn from(value: RollingStockModel) -> Self { RollingStockForm { - common: RollingStockCommon { - name: value.name, - effort_curves: value.effort_curves, - base_power_class: value.base_power_class, - length: value.length, - max_speed: value.max_speed, - startup_time: value.startup_time, - startup_acceleration: value.startup_acceleration, - comfort_acceleration: value.comfort_acceleration, - gamma: value.gamma, - inertia_coefficient: value.inertia_coefficient, - mass: value.mass, - rolling_resistance: value.rolling_resistance, - loading_gauge: value.loading_gauge, - power_restrictions: value.power_restrictions, - energy_sources: value.energy_sources, - electrical_power_startup_time: value.electrical_power_startup_time, - raise_pantograph_time: value.raise_pantograph_time, - supported_signaling_systems: value.supported_signaling_systems, - }, + name: value.name, + effort_curves: value.effort_curves, + base_power_class: value.base_power_class, + length: value.length, + max_speed: value.max_speed, + startup_time: value.startup_time, + startup_acceleration: value.startup_acceleration, + comfort_acceleration: value.comfort_acceleration, + gamma: value.gamma, + inertia_coefficient: value.inertia_coefficient, + mass: value.mass, + rolling_resistance: value.rolling_resistance, + loading_gauge: value.loading_gauge, + power_restrictions: value.power_restrictions, + energy_sources: value.energy_sources, + electrical_power_startup_time: value.electrical_power_startup_time, + raise_pantograph_time: value.raise_pantograph_time, + supported_signaling_systems: value.supported_signaling_systems, locked: Some(value.locked), metadata: value.metadata, } @@ -60,24 +90,24 @@ impl From for Changeset { .railjson_version(ROLLING_STOCK_RAILJSON_VERSION.to_string()) .flat_locked(rolling_stock.locked) .metadata(rolling_stock.metadata) - .name(rolling_stock.common.name) - .effort_curves(rolling_stock.common.effort_curves) - .base_power_class(rolling_stock.common.base_power_class) - .length(rolling_stock.common.length) - .max_speed(rolling_stock.common.max_speed) - .startup_time(rolling_stock.common.startup_time) - .startup_acceleration(rolling_stock.common.startup_acceleration) - .comfort_acceleration(rolling_stock.common.comfort_acceleration) - .gamma(rolling_stock.common.gamma) - .inertia_coefficient(rolling_stock.common.inertia_coefficient) - .mass(rolling_stock.common.mass) - .rolling_resistance(rolling_stock.common.rolling_resistance) - .loading_gauge(rolling_stock.common.loading_gauge) - .power_restrictions(rolling_stock.common.power_restrictions) - .energy_sources(rolling_stock.common.energy_sources) - .electrical_power_startup_time(rolling_stock.common.electrical_power_startup_time) - .raise_pantograph_time(rolling_stock.common.raise_pantograph_time) - .supported_signaling_systems(rolling_stock.common.supported_signaling_systems) + .name(rolling_stock.name) + .effort_curves(rolling_stock.effort_curves) + .base_power_class(rolling_stock.base_power_class) + .length(rolling_stock.length) + .max_speed(rolling_stock.max_speed) + .startup_time(rolling_stock.startup_time) + .startup_acceleration(rolling_stock.startup_acceleration) + .comfort_acceleration(rolling_stock.comfort_acceleration) + .gamma(rolling_stock.gamma) + .inertia_coefficient(rolling_stock.inertia_coefficient) + .mass(rolling_stock.mass) + .rolling_resistance(rolling_stock.rolling_resistance) + .loading_gauge(rolling_stock.loading_gauge) + .power_restrictions(rolling_stock.power_restrictions) + .energy_sources(rolling_stock.energy_sources) + .electrical_power_startup_time(rolling_stock.electrical_power_startup_time) + .raise_pantograph_time(rolling_stock.raise_pantograph_time) + .supported_signaling_systems(rolling_stock.supported_signaling_systems) } } @@ -85,8 +115,8 @@ fn validate_rolling_stock_form( rolling_stock_form: &RollingStockForm, ) -> std::result::Result<(), ValidationError> { validate_rolling_stock( - &rolling_stock_form.common.effort_curves, - rolling_stock_form.common.electrical_power_startup_time, - rolling_stock_form.common.raise_pantograph_time, + &rolling_stock_form.effort_curves, + rolling_stock_form.electrical_power_startup_time, + rolling_stock_form.raise_pantograph_time, ) } diff --git a/front/src/common/api/osrdEditoastApi.ts b/front/src/common/api/osrdEditoastApi.ts index b4d43885c70..3c0b81935da 100644 --- a/front/src/common/api/osrdEditoastApi.ts +++ b/front/src/common/api/osrdEditoastApi.ts @@ -2287,7 +2287,7 @@ export type EffortCurves = { [key: string]: ModeEffortCurves; }; }; -export type RollingStockCommon = { +export type RollingStock = { base_power_class: string | null; comfort_acceleration: number; effort_curves: EffortCurves; @@ -2295,16 +2295,21 @@ export type RollingStockCommon = { electrical_power_startup_time?: number | null; energy_sources?: EnergySource[]; gamma: Gamma; + id: number; inertia_coefficient: number; length: number; loading_gauge: LoadingGaugeType; + /** Whether the rolling stock can be edited/deleted or not. */ + locked: boolean; mass: number; max_speed: number; + metadata: RollingStockMetadata; name: string; /** Mapping of power restriction code to power class */ power_restrictions: { [key: string]: string; }; + railjson_version: string; /** The time it takes to raise this train's pantograph in seconds. Is null if the train is not electric. */ raise_pantograph_time?: number | null; rolling_resistance: RollingResistance; @@ -2312,16 +2317,32 @@ export type RollingStockCommon = { startup_time: number; supported_signaling_systems: RollingStockSupportedSignalingSystems; }; -export type RollingStock = RollingStockCommon & { - id: number; - /** Whether the rolling stock can be edited/deleted or not. */ - locked: boolean; - metadata: RollingStockMetadata; - railjson_version: string; -}; -export type RollingStockForm = RollingStockCommon & { +export type RollingStockForm = { + base_power_class: string | null; + comfort_acceleration: number; + effort_curves: EffortCurves; + /** The time the train takes before actually using electrical power (in seconds). Is null if the train is not electric. */ + electrical_power_startup_time?: number | null; + energy_sources?: EnergySource[]; + gamma: Gamma; + inertia_coefficient: number; + length: number; + loading_gauge: LoadingGaugeType; locked?: boolean | null; + mass: number; + max_speed: number; metadata: RollingStockMetadata; + name: string; + /** Mapping of power restriction code to power class */ + power_restrictions: { + [key: string]: string; + }; + /** The time it takes to raise this train's pantograph in seconds. Is null if the train is not electric. */ + raise_pantograph_time?: number | null; + rolling_resistance: RollingResistance; + startup_acceleration: number; + startup_time: number; + supported_signaling_systems: RollingStockSupportedSignalingSystems; }; export type TrainScheduleScenarioStudyProject = { project_id: number; diff --git a/front/src/modules/rollingStock/types.ts b/front/src/modules/rollingStock/types.ts index f19f40311fe..5f6d80d002c 100644 --- a/front/src/modules/rollingStock/types.ts +++ b/front/src/modules/rollingStock/types.ts @@ -2,7 +2,7 @@ import type { EffortCurveConditions, LoadingGaugeType, RollingStockComfortType, - RollingStockCommon, + RollingStock, } from 'common/api/osrdEditoastApi'; export type RollingStockParametersValidValues = { @@ -11,7 +11,7 @@ export type RollingStockParametersValidValues = { | string | number | null - | RollingStockCommon['power_restrictions'] + | RollingStock['power_restrictions'] | string[] | MultiUnitsParameter; railjsonVersion: string; @@ -40,7 +40,7 @@ export type RollingStockParametersValidValues = { electricalPowerStartupTime: number | null; raisePantographTime: number | null; basePowerClass: string | null; - powerRestrictions: RollingStockCommon['power_restrictions']; + powerRestrictions: RollingStock['power_restrictions']; supportedSignalingSystems: string[]; }; @@ -50,7 +50,7 @@ export type RollingStockParametersValues = { | string | number | null - | RollingStockCommon['power_restrictions'] + | RollingStock['power_restrictions'] | undefined | string[] | MultiUnitsParameter; @@ -80,7 +80,7 @@ export type RollingStockParametersValues = { electricalPowerStartupTime: number | null; raisePantographTime: number | null; basePowerClass: string | null; - powerRestrictions: RollingStockCommon['power_restrictions']; + powerRestrictions: RollingStock['power_restrictions']; supportedSignalingSystems: string[]; };