Ability to query customers Delivery Area using BrewwQL

Hi,
It would be useful to be able to query the delivery area a customer is in using BrewwQL.

Currently, as a workaround, we assign the relevant static delivery area tag to each customer. But this is time-consuming, prone to mistakes, and is difficult to scale.

Thanks

1 Like

Thanks for the suggestion, Michael. I can see how this would be useful.

The difficulty here (and why this isn’t already an option) is that a customer can fit into multiple delivery areas (you can draw overlapping areas). There might well be a good solution to this that we can implement, but I wanted to give you some background on why this is not there already :+1:

Treating it similar to a tag with the same query operators would be fine wouldn’t ir @luke ?

1 Like

It’s not as simple as it sounds as we also never store that a customer is part of a delivery area and for performance reasons BrewwQL filters can only interact with “stored” data.

Currently, each time we need to know if a customer is in a delivery area, we work it out at the time. Doing this for all customers on all queries would be too slow.

So yes, we could use a similar approach as we have with tags, but we’d first need to start to store which customers were in which areas and ensure that every time a customer’s address was updated we checked all delivery areas, and every time a delivery area was updated we checked all customer accounts to see if they matched the new area.

All of this means that what feels like a simple request on the surface is actually far more substantial than it looks. Keep the votes coming though and let’s get it moved up the priority list :+1:

Great news! Delivery Area is now available for use with BrewwQL. It can be used in filters and also as a field to view in reporting.

@craig-edmunds, I have also exposed the field in the customers-suppliers endpoint in the API.

We hope this helps!

1 Like

This topic was automatically closed after 5 days. New replies are no longer allowed.