Business Context
App Workflow
- Users log in and see items available at the nearest merchant.
- Users add items to a virtual shopping cart.
- Users check out the cart as a single order, which is delivered to their location.
- Each order item has a landed cost price and an effective selling price
- Effective selling price is calculated as the base selling price minus any discounts or promotions.
Key Metrics
These are the key metrics that the business is interested in:- GMV: Sum of the selling price of all orders.
- Total Margin: Sum of the margin (selling price - landed cost price) of all orders.
- Aggregations by date, merchant and product category.
Additional Complexity
- Each merchant acquires items from vendors in batches, with varying prices.
- The effective landed cost price is a weighted rolling average recalculated daily.
- Promotions are applied at the item level.