Your map now holds a checked trace of one order, a system map of the shop’s modules, the path of 750 pence to the screen, and the rules the shop relies on. That’s everything you need to answer Grace’s first-day question, and she’s asked it again, with a customer’s report attached.
In this project, you’ll explain how a discount code gets applied to an order, from the staff desk’s form to the stored order, and why one customer’s codes didn’t work. You’ll write it as one page that Grace could hand the next new hire, and every sentence on it will rest on a line you found or a run you made. Start with what the customer saw.
Read the Customer’s Report
Grace’s message is short: “How does a discount code actually get applied to an order? A customer says her code didn’t work.” Mei Tan bought Small Maps at the counter and handed over two flyers. Staff typed READ20, WELCOME10 into Discount code as she read the codes out, and the staff desk displayed Unknown or inactive discount code.
You’ve met that message before. In the OLD120 run, line 7 of findDiscount() in src/discounts/codes.js threw it because no active record matched the typed code. So the message tells you where the order stopped, but not why that check was the one that rejected the input.
Now compare that with what Grace asked for. The ## Discounts part of docs/REQUESTS.md, lines 17 to 21, reads: