Clarification needed in specification: Delivery customer ordering failure and driver assignment timing

The specification describes two failure paths during the ordering phase for in-house customers (Section 2.2, Front of House):

“In case one or more customers couldn’t find a dish, they do not place an order and leave the restaurant.”

However, for delivery customers, the specification does not define equivalent behavior. I would like clarification on the following two points:

1. What happens when a delivery customer cannot find a suitable dish?

After the browsing service assigns a restaurant to a delivery customer group, the group proceeds to order dishes. The ordering rules (page 18) state that customers select dishes based on excluded ingredients, favorite dishes, and preferred ingredients. If no dish matches for one or more customers in the group, what is the expected behavior?

Do the unmatched customers leave the group (and the remaining customers still place the delivery order)?

Does the entire group abort the delivery, and if so, at what point (before or after a driver would have been assigned)?

Should a log message be generated, and if so, which one?

2. When is a delivery driver assigned?

The specification states:

“For deliveries, the meals queue until all meals of an order are ready and a driver is free.” (page 14)

This suggests driver assignment happens after the order is placed and meals are cooked. However, the browsing service checks whether “a delivery driver is currently free” (page 19) when matching casual groups to restaurants.

Does this mean:

The driver is reserved during browsing and locked for this group?

Or is the driver merely checked for availability, and actual assignment happens only after successful ordering (meaning the driver could be taken by another group in the meantime)?

A related concern: if driver availability is checked during browsing but assignment is deferred, a group might pass browsing, fail ordering, and then release a driver that was never actually assigned or conversely, a driver checked as “free” might no longer be available when cooking finishes.

1 Like

please check this post where the same question was asked and i replied to it.

If order is not placed as in the post mentioned then the driver is not assigned yet.

The driver is not locked or reserved during browsing; the browsing service merely decrements its estimated count of available drivers to prevent other groups from choosing a restaurant that is reaching capacity. The actual, physical driver assignment happens strictly during the Serving phase of a tick, once all meals in the delivery order are cooked and a driver is physically free at the restaurant to receive them.

If a group fails ordering: Because the order fails immediately, no cooking starts and no physical driver is ever assigned. If a driver is busy when cooking finishes: Since drivers can only deliver one order at a time and must return before starting another, completed meals will simply queue at the restaurant until a driver physically returns and becomes free.