The pickup counter: three screens, one desk
The tailor from the lesson hands finished alterations back three ways: over the counter, from a locker kiosk, and through a courier app. Each pickup finds the order, takes the balance, releases the garment from the rack and texts a receipt. Each level starts from the previous level’s finished code, so you can begin at any of them.
Customers whose garment could not be found were charged, then waited days for a refund. The shop has replaced its till with a card terminal: authorize holds the balance on the card, capture takes the held amount, and cancel releases a hold without taking anything. The counter, the kiosk and the courier app must not change.
Until the desk moves to the terminal, a garment nobody can find is still paid for, and the shop pays the refund fees. If the callers learned about holds and captures, every screen would change for a decision none of them should make.
Reproduce Open a desk with the rack stuck and call counterPickup(desk, "A-1"). Mina should not be charged for a coat nobody can find. Today $40 is taken.
Acceptance criteria The desk takes payments through the terminal: it holds the balance before releasing the garment and captures it only once the garment is released. A garment that cannot be released is refused with nothing taken and nothing left on hold. A declined card, an order that is not ready and a receipt that fails are reported as before; the card is never asked for an order that is not ready. No caller changes. Notes Cases print each pickup, then the ledger: money taken, the amount still held on cards, how many times the card was asked for a hold, receipts sent, and the order’s status. Keep the desk’s and the callers’ names and signatures; the checker calls them. When the desk no longer uses the till you may remove it, and have the plumbing that counts the money taken read the terminal alone.