Skip to content

Instantly share code, notes, and snippets.

@guyboertje
Created April 17, 2012 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guyboertje/2406094 to your computer and use it in GitHub Desktop.
Save guyboertje/2406094 to your computer and use it in GitHub Desktop.
Entity related Sales
Regards the building of collections of documents for entity reporting.
Prerequisites:
Import of entities
Import of products
Import of users
Actions:
Import of historic sales
Import of joining/leaving mailinglists
An Entity Sale Doc:
Measures:
Price paid
Price list
Currency
Discount (%)
Price paid GBP
Price list GBP
Dimensions:
EntityId
ProductId
UserId
Coordinates [lat, lng]
Date
Year
Month
Country
City
Postcode
WorldRegion
product_id: <- SaleProduct.ProductID
entity_id: <- Derived
user_identifier: <- Buyer.UserID || ContactDetails.Email
ip_address: <- Payment.IPAddress
date: <- Payment.DateCreated (rfc2822 format e.g. 21 Feb 2011 18:53:36 +0400)
country: <- ContactDetails.CountryIso
city: <- ContactDetails.City
postal_code: <- ContactDetails.PostalCode
price_paid: <- SaleProduct.Price
base_price: <- SaleProduct.BaseProductPrice
rate_to_gbp: <- SaleProduct.AccountToGBPExchangeRate
currency: <- SaleProduct.CurrencyIso
sale_id: <- Sale.Key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment