Weird Schema Constraint

Hello,

When looking at the schema file for customer groups again today I noticed that one of the constraints for casual groups is being handled in a weird way.

Screenshot 2026-09-20 164656

This constraint means that not both keys can be present at the same time. The tableType has a default value of “COMMON” if the key is not present. deliveryDistance does not have a default value but a minimum value of 0.

Now the interesting case is when only the deliveryDistance key is given and it is 0.

In order to have a casual group be a delivery group, the deliveryDistance has to be greater than 0. So in this case, we would have an in-house group.

But then what is the point of even having the deliveryDistance key being allowed to have the value 0 if it doesn’t matter anyway? It seems like the reference implementation treats this case as an in-house group with table type COMMON (because of the default value).

But I would have expected that if you specifically only provide the deliveryDistance key, that it should actually be a delivery group and not an in-house one.

1 Like

Hi, the spec defines deliveries by the value, not by whether the key is present:

deliveryDistance > 0 means it is a delivery.

So a CASUAL group with only "deliveryDistance": 0 is an in-house group. Since there’s no tableType, it gets the default COMMON. 0 is allowed because it means “no distance”, i.e. the group comes to the restaurant. It’s just the same as leaving the key out.

1 Like