Closed arne-z closed 1 week ago
@ruegenbfr
This is still a little bit messy, I am not super happy with the amount of code duplication between the import stations and the import deliveries functions, but I couldn't figure out a clean way to use templates for this today. If you have any ideas here, I'm open to them.
I'm also unhappy with the getWarnings
function right now. I didn't find a nice solution here, because it feels like the entire filtering shouldn't be happening to begin with. The need to filter our warnings for only those that we currently have Texts for is awkward. I'm imagining we maybe need a getWarningText function that has a switch case, mapping warnings to their respective issue aggregator texts, which can then have a default for handling warnings we don't have text for yet? This doesn't feel correct either, and leaves up with the awkwardness of slicing up the issues along their types into different arrays.
So yeah, two spots where I would really like some input on how you would go about solving them.
This PR only contains the behavior of filtering out duplicate IDs in station and delivery import, and writing the requested Error messages into the warning state. It is targeted at the template-warnings feature branch and should not be merged or considered complete on its own.