New feature: preparation time

Assume you have multiple deliveries in a shopping mall. However, before delivery your driver needs to find a parking lot that takes 10 minutes in average. How do you consider this parking search time in your request? Up to now, you could only take this into account implicitly, e.g. by adding a markup to the “duration” of each delivery. However, there is an obvious difference between parking search time and delivery duration. Parking search is dependent on the location of the service and not the service itself. If there are a number of services at the same location, parking search should only be considered once. This is what you can now model with “preparation_time” like this:

{
      "id": "1",
      "name": "deliver_item_A",
      "address": {
        "location_id": "my_location",
        "lon": 9.999,
        "lat": 53.552
      },
      "preparation_time":1800
    },
    {
      "id": "2",
      "name": "deliver_item_B",
      "address": {
        "location_id": "my_location",
        "lon": 9.999,
        "lat": 53.552
      },
      "preparation_time":1800
}  

“preparation_time” is 30min at location “my_location”. If delivery 1 and 2 are delivered in sequence then “preparation_time” only considered once. If there is another delivery in between 1 and 2, it is considered twice. Note that you can still model delivery “duration” which is considered for each delivery independently.

Note also that “preparation_time” must be equal for two identical locations, otherwise you will receive this error:

{
  "message": "Bad Request",
  "hints": [
    {
      "message": "there is already a preparation time associated to location my_location. they should be equal.",
      "details": "class java.lang.IllegalArgumentException"
    }
  ]
}
2 Likes

Hi @stefan,

Just wondering, why the preparation time is not put in the address object? Just want to make sure I have not missed anything. Thanks.

Best regards,
He

Hello @jie31best,

Even preparation time is related to the location, we felt that it is odd to put it in the address object. However, we discussed this as well.

Best,
Stefan