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.
The courier’s handheld loses signal often, and drivers complained that pickups came back without a receipt. A teammate’s pull request adds collectWithRetry: when a pickup does not come back released and texted, run it again, up to three times. You are reviewing it.
A driver who is told the pickup failed leaves without the coat the customer already paid for, or calls the shop to sort out a charge that the screen says never happened. Each repeated attempt asks the customer’s card again.
Reproduce Open a desk whose text gateway fails once and call courierPickup(desk, "A-1"). The coat should be collected with its receipt sent. Today the courier’s screen says the pickup was refused because the order is collected, though $40 was taken.
Acceptance criteria The courier’s screen shows what happened to the customer’s order: a collected order is reported as collected. A receipt that fails to send is tried again, up to three attempts in all; nothing else is repeated. A refused pickup (a stuck rack, a declined card) asks the card once. Calling the courier twice for the same order still takes the money once; the second call is refused because the order is collected. The counter and the kiosk are unchanged. Notes Cases print each pickup, then the ledger: money taken, the amount still held, how many times the card was asked, receipts sent, and the order’s status. Keep the desk’s collect and the callers’ names and signatures; the checker calls them. You may add an operation to the desk, or remove collectWithRetry.