Skip to content

Commit 5863ffc

Browse files
committed
design-docs: new migration plan
1 parent 1408dce commit 5863ffc

File tree

1 file changed

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

1 file changed

+57
-37
lines changed

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

+57-37
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,29 @@ 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+
78101
## Creation fields
79102

80103
These fields are required at creation time, but cannot be changed afterwards.
@@ -143,67 +166,64 @@ GET /v2/timetable/ID/conflicts
143166
# Projects the space time curves and paths of a number of train schedules onto the path of another one
144167
GET /v2/timetable/ID/project_path?onto=X&ids[]=Y&ids[]=Z
145168

146-
POST /v2/train_schedule
169+
POST /v2/train_schedule # Can be a batch creation
147170
GET /v2/train_schedule/ID
148171
GET /v2/train_schedule/ID/path
149-
PATCH /v2/train_schedule/ID
172+
PATCH /v2/train_schedule/ID # TODO what operation is allowed
150173
DELETE /v2/train_schedule/ID
151174

152-
POST /v2/infra/ID/pathfinding/topo
175+
POST /v2/infra/ID/pathfinding/topo # Not required now can be move later
153176
POST /v2/infra/ID/pathfinding/blocks
154-
155-
# 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
157177
```
158178

179+
## Missing things TODO
180+
181+
- Adapt import train schedules from open data
182+
- Patch train schedule ?
183+
- Train validity ?
184+
- Scenario change the front behavior using the new timetable endpoint
159185

160186
## Migration plan
161187

162-
### Phase 0
188+
### Phase 1
163189

164-
- Start the redesign the margin / power restrictions UI
190+
Front:
165191

166-
### Phase 1
192+
- Design margin interface and scheduled points
167193

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.
194+
Back:
172195

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

175199
### Phase 2
176200

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)
201+
Front (using legacy train schedules):
182202

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

185-
### Phase 3
206+
Back:
186207

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
208+
- Implement pathfinding endpoint
209+
- Implement path endpoint of a `train_schedule`
193210

194-
About 1 month
211+
### Phase 3
195212

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

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
215+
- Handle pathfinding separated from the train schedule
216+
- Handle invalid rolling stocks
201217

202-
About 1 month
218+
Back:
203219

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

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

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

0 commit comments

Comments
 (0)