Skip to content

Instantly share code, notes, and snippets.

@mcfunley
Created August 17, 2010 21:01
Show Gist options
  • Save mcfunley/532011 to your computer and use it in GitHub Desktop.
Save mcfunley/532011 to your computer and use it in GitHub Desktop.
// Purchases: these cause a proliferation of events because there
// are a minimum of three entities in the system that people can
// be interested in that take part: the buyer, the shop, and the
// item.
//
// For consistency we'll generate all of these activities, but it
// wouldn't make sense to display all of them. People interested
// in an item would see (item, purchased_by, buyer). People
// interested in a shop would see (shop, sold_to, buyer), maybe
// aggregated to show several sales. People interested in a
// buyer would see (buyer, purchased, item) or
// (buyer, bought_from, shop) depending on whether or not it was
// a multi-item checkout, but not both.
/**
* Action assigned to a user who has purchased an item.
*/
const purchased = 0x0004;
/**
* Action assigned to an item that has been purchased.
*/
const purchased_by = 0x8004;
/**
* Action assigned to a person that bought from a shop.
*/
const bought_from = 0x0005;
/**
* Action assigned to a shop that sold to a buyer.
*/
const sold_to = 0x8005;
@kellan
Copy link

kellan commented Aug 17, 2010

Seems like this is exactly the reason we're building the aggregator step into the model is this proliferation.

Btw are you planning to do bit masking with those hex values or what?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment