Skip to content

[Feature request]: (wip) Remove unused fields of NetzgrafikDto #644

@louisgreiner

Description

@louisgreiner

Preflight Checklist

Request type

Request for enhancement of a component

Functionality

The current NetzgrafikDto is composed of many attributes, some are unused, at least as far as I know. This issue aims to remove them, to simplify this object and reduce the JSON payload. Some of these fields are anyway recalculated at loading etc.

The idea behind this issue would be also to simplify the NetzgrafikDto.

Current interface:

export interface NetzgrafikDto {
  nodes: NodeDto[]; // list of all nodes - analog database (DB) table
  trainrunSections: TrainrunSectionDto[]; // list of all trainrun sections - analog DB table
  trainruns: TrainrunDto[]; // list of all trainruns - analog DB table
  resources: ResourceDto[]; // list of all resources - analog DB table
  metadata: MetadataDto; // global settings / definitions
  freeFloatingTexts: FreeFloatingTextDto[]; //list of all notes - analog database (DB) table
  labels: LabelDto[]; // list of all labels - DB table (filterable labels)
  labelGroups: LabelGroupDto[]; // list of all label groups - DB table (filterable groups)
  filterData: FilterDataDto; // reference to the filter settings (predefined filters)
}

Fields:

  • NetzgrafikDto.trainrunSections.path: this is recalculated anyway at loading.

Other considerations (that may need more refactoring that just not including them in the dto):

  • Can NetzgrafikDto.resources be agregated in associated NetzgrafikDto.nodes? Since this refers to the "capacity" of a station (= number of docks in a node)? I don't understand why the two objects have different life times. I would recommand doing NetzgrafikDto.nodes.capacity (int) directly instead.
  • Can NetzgrafikDto.nodes.symmetryAxis be droped? I don't see any use of this. This looks deprecated.
  • Can NetzgrafikDto.trainrunSections.specificTrainrunSectionFrequencyId be droped? This looks deprecated, even tho I see the how it could be used, since it is not already I recommand removing it and if needed in the future re-think the whole feature.
  • Globally, I see many uses of id: 0 -> this is dangerous, we should never have id = 0 (i.e. trainrunCategories, trainrunFrequencies, trainrunTimeCategoryId...)

Link to design proposal file

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions