Your Ticket 🎫
Welcome to ShopCo. The
OrderManager class has been growing for 3 years.
It now validates orders, calculates pricing, updates inventory, sends email
confirmations, and saves to the database — all in one 200-line monster.
Every feature request touches
OrderManager. Bugs in pricing break
notifications. Tests are impossible to write without a database.
Your mission:
Refactor
OrderManager so that each responsibility lives in its own class:
1.
Validation — Is the order valid? Sufficient stock?
2.
Pricing — Calculate totals, discounts, tax
3.
Inventory — Update stock levels
4.
Notification — Notify the customer
5.
Persistence — Save the order record
OrderManager should orchestrate these, not implement them.
You'll be scored on *structure*, not runtime behavior.