feat: add transfer risk logic - #62
Conversation
| export const InterchangeRisk = { | ||
| Uncertain: 'uncertain', | ||
| Unlikely: 'unlikely', | ||
| } as const; |
There was a problem hiding this comment.
What is the benefit of using const value objects instead of just using union types?
There was a problem hiding this comment.
Was thinking that we can use InterchangeRisk.Uncertain with the const instead of union types, and const keeps the value in runtime?
| * Classifies the gap between arriving and the next departure. Zero counts as | ||
| * uncertain; a non-finite gap yields undefined. | ||
| */ | ||
| export const getInterchangeRisk = ( |
There was a problem hiding this comment.
I feel like generally using the term transfer instead of interchange would be beneficial, since this logic doesn't just apply when there are interchanges?
There was a problem hiding this comment.
It is called interchange because it was "overgang", and I was thinking we already have "korrespondanse" for guaranteed interchange.
I'll just rename it 👍🏼
There was a problem hiding this comment.
I think transfer is more fitting, it is the term Entur uses for this, for example in parameters like transferSlack and transferPenalty.
There was a problem hiding this comment.
Renamed everything to transfer, except interchangeTo since it is Entur keyword
Part of https://github.com/AtB-AS/kundevendt/issues/24416
This will add interchange risk rule function, which will be used by both BFF and Planner-Web, while the App consumes the data from BFF.