Checkout price engine with pluggable discounts
Build the price engine for an e-commerce checkout. A cart holds line items (product id, unit price, quantity) and the customer has a tier, standard or premium. Apply discounts of several kinds (a percentage off, a fixed amount off, and buy X get Y) and return the final total. Design it so new discount types plug in without changing the engine.
No answer yet. Write the first one; the best answer gets endorsed.
