opentripmodel / otm5-change-requests

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

Adding containedGoods array to Vehicle entity #91

Open Hans-Simacan opened 4 weeks ago

Hans-Simacan commented 4 weeks ago

Type of request

Is your feature request related to a problem? In the current model you can't specify the starting "configuration" of a Vehicle, or in other words did the vehicle already have loaded items or attached trailers at the start. You can have a trailer attached or detached through an action, but you can't specify whether the vehicle starts on a trip already with an attached trailer. So basically there is always an action needed which is related to a certain moment in time.

Secondly the OTM model also doesn't allow you to describe the configuration of the vehicle (after multiple attach/detach/load/unload actions) at any moment in time.

Sample: You have a vehicle, you attach two transportEquipment and load 4 loadcarriers. Next you unload 2 loadcarriers and detach one transportEquipment. How can you describe in the OTM model the current setup / configuration of the Vehicle.

Describe the solution you'd like We would like to add the property containedGoods to the vehicle, which can describe the configuration / load of the vehicle. This would be an array of the Goods entity.

Example:

{
   "vehicle":{
      "associationType":"inline",
      "entity":{
         "vehicleType":"TREKKER",
         "licensePlate":"ACHTERES_test_license",
         "fuel":"diesel",
         "containedGoods":[
            {
               "associationType":"inline",
               "entity":{
                  "id":"a29905bb-9af8-4118-896a-71b1eaf07cc0",
                  "type":"transportEquipment",
                  "description":"A trailer",
                  "width":{
                     "value":2.46,
                     "unit":"m"
                  },
                  "height":{
                     "value":2.7,
                     "unit":"m"
                  },
                  "length":{
                     "value":13.62,
                     "unit":"m"
                  },
                  "licensePlate":"123-ABC"
               }
            },
            {
               "associationType":"inline",
               "entity":{
                  "id":"anotherValidId",
                  "type":"transportEquipment" or "items"
               }
            },
            ...
         ]
      }
   }
}

In this way you consider the Vehicle also a transportEquipment being able to contain goods, where goods can be either transportEquipment or items, just like it is within the transportEquipment itself.

Describe alternatives you've considered Did you try to solve it with the current specification? If so, how? Please be as clear and concise as possible. Alternatives considered are:

This also enables the model to describe the items in a vehicle at any point of time.

Additional context Adding the initial configuration using containedGoods:

Hans-Simacan commented 3 weeks ago

We have been reconsidering this request. We found an other alternative:

So, this solution can work but requires some unambiguous agreements between the parties using the solution. Or a very clear instruction within the OTM5 specification.

We will use it in a carrier-enrichment call with the agreement that if two or more consecutive calls are received we only treat the last one as the valid one. (Meaning the later ones will override the information of the prior ones)