ActivitySchema / ActivitySchema

Repository for the ActivitySchema spec and supporting materials
Apache License 2.0
401 stars 30 forks source link

Combining Entities #6

Open gustavofgt opened 3 years ago

gustavofgt commented 3 years ago

Hi there. How to combine multiple entities/dimensions?

For example, supose I have a supermarket chain and I want to know:

Grossery items (product family) and State should be added to the features attributes of the customer_stream activity? What if I want to zoom in trough these dimensions (product name and city)?

cdussud commented 3 years ago

Hey Gustav. Each activity only holds data specifically about that activity.

For example, a 'completed_order' event would have a total amount paid, but not necessarily the state it was purchased in.

To track the exact list of items purchased you could make a 'purchased_item' activity for each individual item in the order. That activity could have item sku, item name, item category (i.e. grocery).

It helps to also think about who is the customer for the activity stream too. In your case the customer could be a store instead of a person.

So the 'completed_order' event's 'customer' would be store_123. The store would have metadata saying its country / state. So from that you have all the pieces to put together the queries you mentioned.

Let me know if that makes sense!