Skip to content

Commit bed13ca

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

File tree

1 file changed

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

1 file changed

+44
-37
lines changed

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

+44-37
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,22 @@ 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+
### Why a train schedule could be invalid (TODO: Still in progress)
80+
81+
There is new reasons for a train schedule to be invalid:
82+
83+
Pathfinding response:
84+
85+
- Rolling stock not found
86+
- The path connot be found
87+
88+
89+
- Inconsitent train schedule (contains deleted waypoint)
90+
91+
- The infra changed
92+
- The rolling stock changed
93+
7894
## Creation fields
7995

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

146-
POST /v2/train_schedule
162+
POST /v2/train_schedule # Can be a batch creation
147163
GET /v2/train_schedule/ID
148164
GET /v2/train_schedule/ID/path
149-
PATCH /v2/train_schedule/ID
165+
PATCH /v2/train_schedule/ID # TODO what operation is allowed
150166
DELETE /v2/train_schedule/ID
151167

152-
POST /v2/infra/ID/pathfinding/topo
168+
POST /v2/infra/ID/pathfinding/topo # Not required now can be move later
153169
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
157170
```
158171

159172

160173
## Migration plan
161174

162-
### Phase 0
175+
### Phase 1
163176

164-
- Start the redesign the margin / power restrictions UI
177+
Front:
165178

166-
### Phase 1
179+
- Design margin interface and scheduled points
167180

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.
181+
Back:
172182

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

175186
### Phase 2
176187

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

183-
About 1 month
190+
- Adapt margin interface to the new design
191+
- Handle scheduled points
184192

185-
### Phase 3
193+
Back:
186194

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
195+
- Implement pathfinding endpoint
196+
- Implement path endpoint of a `train_schedule`
193197

194-
About 1 month
198+
### Phase 3
195199

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

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
202+
- Handle pathfinding separated from the train schedule
203+
- Handle invalid rolling stocks
201204

202-
About 1 month
205+
Back:
203206

204-
### Phase 5
207+
- Move and adapt `project_path` endpoint
208+
- Move `conflicts` endpoint
209+
- Move and adapt STDCM endpoint
210+
- Adapt timetable import with new endpoints
211+
212+
### Phase 4
205213

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

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

0 commit comments

Comments
 (0)