Build One-Call Checkout
Facade pattern
Challenge 2 of Wrap & ExtendBeginner~55 minFree
Checking out an order really means three separate jobs, reserving stock, charging a card, and booking a shipment, each with its own failure mode. The Facade pattern hides that messy orchestration behind one friendly call. Build a CheckoutFacade over in-memory Inventory, Payment, and Shipping subsystems, add rollback when a step fails, return a tracking id on success, keep an order log, and finish with a one-argument quick_buy convenience method.