Skip to content

[Feature request]: Add more details to NGE trainrun events #792

@emersion

Description

@emersion

Discussion with @Synar @louisgreiner @emersion @Akctarus

OSRD bugs:

Possible solutions:

  • ✅ Add more data to NGE events, e.g. a tag explaining what changed
  • ❌ Introduce a new event for trainrun changes with only fields which got changed

Focus on trainruns for now.

Tags indicating what changed:

  • trainrunSections
    • trainrunSections.nodes (OSRD: path, schedule, reset margins)
    • trainrunSections.times (OSRD: schedule, ⚠️ use old path step IDs
      instead of assuming ${node.id}-${})
    • trainrunSections.numberOfStops (OSRD: no-op)
  • name (OSRD: train_name)
  • categoryId (OSRD: category)
  • frequencyId (OSRD: paced)
  • trainrunTimeCategoryId (OSRD: no-op)
  • labelIds (OSRD: labels)
  • direction (OSRD: special snowflake)
    • For one-way, call generatePathAndSchedule() depending on
      oneWayDirection, then store train schedule
    • For round-trips, create return train schedule based on previous one-way
      train schedule (should be current behavior)

Then add a list of tags to TrainrunOperation, plus a field to indicate
one-way direction:

class TrainrunUpdateOperation extends TrainrunOperation {
  readonly tags: []TrainrunUpdateTag;
  readonly oneWayDirection?: "forward" | "backward";
}

For trainrun duplication:

class TrainrunCreateOperation extends TrainrunOperation {
  readonly duplicatedTrainrunId?: number;
}

Link to design proposal file

No response

Metadata

Metadata

Assignees

Labels

area:servicesServices, helpers, utils and i18n ("logical" stuff)feature-requestA request of a new feature of the enhancement of an existing one

Projects

Status

Awaiting merge

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions