Skip to content

Commit 62e6932

Browse files
committed
design-docs: new migration plan
1 parent e7187c6 commit 62e6932

File tree

1 file changed

+56
-37
lines changed
  • content/docs/reference/design-docs/timetable

1 file changed

+56
-37
lines changed

content/docs/reference/design-docs/timetable/index.en.md

+56-37
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,31 @@ We also discussed whether to use seconds or ISO 8601 durations. In the end, ISO
7575
- it interfaces nicely with the ISO 8601 departure time
7676
- it does not suffer from potential integer-float serialization related precision loss
7777

78+
79+
### Invalid and outdated train schedules
80+
81+
Reasons for a train schedule to be **invalid**:
82+
83+
- Inconsitent train schedule (contains deleted waypoint)
84+
- Rolling stock not found
85+
- Path waypoint not found
86+
- The path cannot be found
87+
88+
Reasons for a train schedule to be **outdated**:
89+
90+
- The train path changed
91+
- The train running time changed
92+
93+
What we can do about outdated trains:
94+
95+
1. Nothing, they're updated without notification
96+
2. We can notify the user that a train schedule is outdated:
97+
- Nothing can be done except acknoledge the change
98+
- We can not check what changed between the old and new version
99+
- We can not know the cause of this change (RS, Infra, Algorithms...)
100+
101+
Note: The outdated status is a nice to have feature (it won't be implemented right now).
102+
78103
## Creation fields
79104

80105
These fields are required at creation time, but cannot be changed afterwards.
@@ -139,71 +164,65 @@ options:
139164
POST /v2/timetable
140165
DELETE /v2/timetable/ID
141166
GET /v2/timetable/ID
167+
GET /v2/timetable/
142168
GET /v2/timetable/ID/conflicts
143169
# Projects the space time curves and paths of a number of train schedules onto the path of another one
144-
GET /v2/timetable/ID/project_path?onto=X&ids[]=Y&ids[]=Z
170+
GET /v2/timetable/ID/project_path?infra=N&onto=X&ids[]=Y&ids[]=Z
145171

146-
POST /v2/train_schedule
172+
POST /v2/train_schedule # Can be a batch creation
147173
GET /v2/train_schedule/ID
148-
GET /v2/train_schedule/ID/path
174+
GET /v2/train_schedule/ID/path?infra_id=42
149175
PATCH /v2/train_schedule/ID
150176
DELETE /v2/train_schedule/ID
151177

152-
POST /v2/infra/ID/pathfinding/topo
178+
POST /v2/infra/ID/pathfinding/topo # Not required now can be move later
153179
POST /v2/infra/ID/pathfinding/blocks
154180

155181
# takes a path (the output of pathfinding/blocks) and a list of properties that need extracting
156-
POST /v2/infra/ID/path_properties?properties=slopes,gradients,electrification,neutral_sections
182+
POST /v2/infra/ID/path_properties?properties=slopes,gradients,electrification,neutral_sections,geometry
157183
```
158184

159-
160185
## Migration plan
161186

162-
### Phase 0
187+
### Phase 1
163188

164-
- Start the redesign the margin / power restrictions UI
189+
Front:
165190

166-
### Phase 1
191+
- Design margin interface and scheduled points
167192

168-
- core: Implement v2 pathfinding endpoints in core, without removing the old ones
169-
- editoast: Implement the timetable v2 endpoints, and patch v1 endpoints to use the new model. As timetables currently are created automatically with scenarios, we can use this API to create new style timetables all the time.
170-
- editoast: implement v2 pathfinding endpoints, without removing the old ones
171-
- editoast: Implement v2 train schedule endpoints, extending existing tables: v1 endpoints still always work, and v2 endpoints work as long as the train schedule was created using v2 endpoints (we need to have the new-style path description). All train schedules still have a path ID, which can only be seen with the v1 API. For margins and power restrictions, a temporary unordered `path_offset` location type is used, and converted on the fly to a `track_offset` location type.
193+
Back:
172194

173-
About 1 month
195+
- Create new tables and associated models (using ModelV2)
196+
- Implement GET / DELETE / POST / PATCH endpoints for these new models
174197

175198
### Phase 2
176199

177-
- editoast: implement the new projection API (2 weeks)
178-
- front: call train schedule v2 endpoints, but still use the old pathfinding endpoints (1 week)
179-
- editoast: implement the new path properties electrification endpoints (1 week)
180-
- front: migrate the power restriction selector to use the new path electrification properties endpoint, which does not need path IDs (1 week)
181-
- editoast: implement path properties extractors, either in editoast directly or via core (decision needed) (2 weeks)
200+
Front (using legacy train schedules):
182201

183-
About 1 month
202+
- Adapt margin interface to the new design
203+
- Handle scheduled points
184204

185-
### Phase 3
205+
Back:
186206

187-
- front: migrate the opendata import (2 weeks)
188-
- front: use the new pathfinding call, which means there is no more path ID (2 weeks parallel)
189-
- front: use the new projections API, which don't need path IDs (2 weeks parallel)
190-
- front: use the new path properties API, which don't need path IDs either (2 weeks parallel)
191-
- front: ensure all path IDs are gone (2 weeks parallel)
192-
- editoast: remove the old style pathfinding result
207+
- Implement pathfinding endpoint
208+
- Implement path endpoint of a `train_schedule`
193209

194-
About 1 month
210+
### Phase 3
195211

196-
### Phase 4
212+
Front (start using the new train schedule model):
197213

198-
- front: implement the new margin / power restrictions UI (1 month)
199-
- front: migrate away from path_offset locations
200-
- editoast: remove the code which converts `path_offset` locations to `track_offset` locations
214+
- Handle pathfinding separated from the train schedule
215+
- Handle invalid rolling stocks
201216

202-
About 1 month
217+
Back:
203218

204-
### Phase 5
219+
- Move and adapt `project_path` endpoint
220+
- Move `conflicts` endpoint
221+
- Move and adapt STDCM endpoint
222+
- Adapt timetable import with new endpoints
223+
224+
### Phase 4
205225

206-
- front: ensure no more v1 calls are left
207-
- editoast: remove all v1 calls
226+
Back:
208227

209-
About 2 weeks, very low intensity
228+
- Remove legacy endpoints and tables and models

0 commit comments

Comments
 (0)