opentripmodel / otm5-change-requests

Tracking and reporting bugs and change requests of the OTM5 specification.
5 stars 1 forks source link

Support a description field on constraint types #56

Closed jeroentervoorde closed 2 years ago

jeroentervoorde commented 2 years ago

Type of request

Is your feature request related to a problem? I need to be able to add multiple types of time window constraints on a stop some way to determine the type of window.

Describe the solution you'd like

Support a description (or name) field to the constraint. For instance:

{
  "type": "andConstraint",
  "and: [
    {
      "description": "block times"
      "type": "timeWindowConstraint",
      "startDateTime": "2021-06-23T10:00:00.000Z",
      "endDateTime": "2021-06-23T13:00:00.000Z",
    },
    {
      "description": "alert thresholds"
      "type": "timeWindowConstraint",
      "startDateTime": "2021-06-23T09:45:00.000Z",
      "endDateTime": "2021-06-23T13:15:00.000Z",
    }
  ]
}  

Describe alternatives you've considered

Use a "windowType" attribute instead of description. This will likely be very implementation specific. Also this same approach can also be used to specify a constraint on the start (or end) time using a {"type": "startDateTimeConstraint"}

bmeesters commented 2 years ago

After discussion we decided to add this to all constraint types. In the future we might add a list of common descriptions as enum, but for now it seems too open to create one.

bmeesters commented 2 years ago

This is now part of OTM5.4