Build a Multi-Warehouse Retail Platform
A home-goods retailer sells the same stock from three warehouses and keeps overselling, double-refunding and showing stale search results. You will build the replacement, from catalog and stock to checkout, payments, split shipments and returns, and prove it with a simulated trading day in which everything that can go wrong does.
The brief
The client
I run e-commerce operations at a home-goods retailer. We take about 4,000 orders a day, 600 an hour at peak, for 18,000 products held in three warehouses (WH1, WH2 and WH3), all sold through one shop application. During a promotion on a stand mixer with 40 units in stock, the shop accepted 112 orders in 20 minutes, because it checked the stock count when the shopper opened the page and never again. We cancelled 72 orders by email and refunded each card by hand, and customers kept writing for two weeks asking where their money was, because a refund shows up on the card 5 to 10 business days later. Since then, an order that ships in two parcels from two warehouses has been charged twice or not at all, depending on who touched it last. I need a shop where the last unit sells once, where every hold on stock or money has an end time, and where I can tell a customer exactly what happened to their order and their money. It also has to keep selling when payment, search or a warehouse tool is down or being updated.
The problem
The shop keeps one stock number per product and checks it when a page loads. Two shoppers can pay for the last unit, and the second order is found out only when a warehouse operator cannot pick it. Stock sits in three warehouses, but the shop sees one total, so an order for three items is assigned by hand and a split into two parcels is a spreadsheet.
Payment is taken at order time, so every cancellation and every short pick becomes a manual refund, and finance reconciles captures against refunds by hand at month end. The client's payment contract charges a fee on each refund that the provider does not return, so every avoidable cancellation after capture costs money. The search results are rebuilt overnight, so a sell-out or a price change reaches search up to a day late; after the mixer sold out, search kept showing it in stock for an hour. Returns arrive at the warehouse with no link to the order line they came from, so refunds are typed in, and some have exceeded what was paid. When the payment provider is slow, the whole shop is slow, and a deploy takes the shop down for everyone.
The client's name and figures are invented for this brief; the rules and the failures are ones that real businesses of this kind work with.
The spec
Requirements
- Let a merchandiser publish, change and withdraw products with a history of who changed what and when, and let a shopper search them by name, category and attribute, with each result shown as in stock or out of stock within 10 seconds of a change at the 95th percentile.
- Reserve stock for a shopper at checkout in specific warehouses for 15 minutes, and never sell the same unit twice, including when 200 buyers go for 10 units at once.
- Let a warehouse operator receive stock, correct a count after a shelf check and transfer stock between warehouses, with transferred units unsellable until they are received.
- Take payment by card through a payment provider, including a payment that needs extra authentication and one the shopper abandons, and never hold stock or money past its deadline.
- Make one order and one charge when the front end places the same order twice, including twice at the same moment.
- Split an order across the warehouses that hold its items, ship each part separately, and show the order as partly shipped.
- Cope with a line a picker cannot find and with a warehouse that goes quiet, by moving the line to another warehouse or cancelling it and refunding it.
- Let a shopper or a support agent cancel an order, or one line of it, before it is picked, with the stock released and the money returned in full.
- Let a shopper return items until 14 days after the last parcel of the order is delivered, inspect them at the warehouse, restock or write them off, and refund only the returned lines with their share of shipping and discount.
- Never refund more than was captured, record every refund with its reason, and give finance a report that shows each order's money adding up.
- Erase a shopper's personal data on request while the order, payment and refund records stay.
- Keep selling when one part of the shop is stopped or being updated: with search stopped, shoppers can still order; with payment stopped, shoppers can still search and warehouses can still ship paid orders; with the warehouse tools stopped, shoppers can still order and pay. Handle 600 orders in the peak hour.
Deliverables
- Your repository starts the whole shop with one command, plus a way to run the client's day faster than real time. The simulated day plays shoppers, a merchandiser, warehouse operators and the clock, and can cause every outside failure the brief names: the payment provider answering late, twice, out of order or not at all, the carrier reporting late or twice, a warehouse going quiet, search stopped, and any part of the shop killed or updated while orders flow.
- A README that takes a reviewer from a fresh clone to an order shipped in two parcels, delivered, partly returned and refunded in 15 minutes, and lists the command that runs each test.
- A document of the stock and money rules, written before the code: every hold and its deadline, and how shipping and discount are shared across lines.
- An integration guide for the shop's front end and the warehouse tools: every action they can take, what they send, what they get back, and the header that makes placing an order safe to repeat.
- A test suite, plus the results of the trading day from the final Phase committed to your repository.
- An operations note stating what an operator must be able to do: trace one order from click to refund, set aside a step that keeps failing and retry it, restore search and the order view, and update one part of the shop while orders keep flowing.
Out of scope
- Handling card numbers or implementing 3-D Secure. The payment provider holds card data and the shop never sees a card number; an order only needs to wait while the shopper authenticates.
- VAT and credit notes on refunds. Tax rules are national, and every price here is the amount the shopper pays.
- Real carrier integration. A stand-in carrier reports shipped and delivered, because a carrier network is a project of its own.
- Promotions, pricing rules and customer accounts. They are separate domains; an order carries the discount and shipping amounts it is given.
- Emails and messages to shoppers. The order view tells a shopper what happened.
- Warehouse management system integration, advance shipping notices and purchasing. Operators use the interface this brief describes.
- Disputes and chargebacks. A bank pulling money back from a refunded payment is a lifecycle of its own; refunds here end when the provider settles them.
- Deleting records after their retention period. Dutch law makes the client keep its business records for 7 years (Belastingdienst), so erasure here removes personal fields and keeps order, payment and refund records, identified by ID, for that period. Deleting them once the 7 years have passed is outside this brief.
- Backorders and delivery-time promises. A line nobody can pick is cancelled and refunded, because a supplier workflow is outside the brief.
- Kubernetes or cloud deployment. Everything runs on one machine, because the failures that matter here come from the outside world.
- Payment methods other than cards, such as iDEAL. The retailer takes cards only, because the card is authorised at checkout and charged at shipment, and iDEAL takes the money at once.
Architectural constraints
- A unit of stock is never sold twice, and only the stock count decides whether an order can go ahead; what search shows is a hint.
- Amounts are exact to the cent, in EUR. Shipping and discount are shared across an order's lines by one stated rounding rule, and the shares always add up to the original amounts.
- Every hold has an end time: a stock reservation lasts 15 minutes and a card authorisation 7 days. The 14-day return window ends 14 calendar days (Europe/Amsterdam) after the last parcel of the order is delivered, for every line. It holds nothing; it is checked when a return is requested.
- A card is charged once per order. A refund is never above what was captured, goes only to the original payment, and has a recorded reason.
- No card number is ever stored or shown to the shop.
- An order's price is fixed when checkout starts. A later catalog change never reprices it.
- A repeated request or message never charges, refunds, restocks or ships twice.
- A part of the shop that is stopped may delay work that depends on it. It never makes the rest of the shop refuse shoppers.
- Personal fields (name, email, delivery address) are erased or pseudonymised on request, wherever they appear, while orders, payments, refunds, returns and stock records stay, identified by ID. The delivery address is erased once the order is closed: every parcel delivered or cancelled, the order's return window over, no return open, no refund pending or failed.
Prerequisites
You should have finished an intermediate project or have equivalent experience, in any language and stack. You do not need to know how card payments work or how a home-goods retailer runs its warehouses; the first Phase explains the business and the words the brief uses, and authorisation, capture and refund are explained where they first appear. Knowing what goes wrong when two people change the same stock count at once will help in the stock Phases.
Free to start. An account is what keeps track of the checkpoints you finish.
Work out the rules and start the shop
Produces the written stock and money rules, two worked examples of the client's rules, and a shop that starts with one command next to a simulated day with a clock. Builds no shop behaviour yet.
Acceptance criteria
Your repository holds a document, committed before any code that implements a rule, that records one order from a shopper's search to a partial return and its refund, one step after another. A reviewer can read it without running anything.
It states every hold and when it ends: a hold on stock for 15 minutes, a card authorisation for 7 days, safety stock of 2 units per SKU per warehouse that shoppers are never offered, and units in transit between warehouses that are sellable nowhere. It shows the 14-day return window, which ends 14 calendar days after the order's last parcel is delivered, as a check made when a return is requested that holds nothing. It states the stock, money and erasure rules in the client's words: how a basket is allocated across WH1, WH2 and WH3, when the card is charged, when a refund is refused, and what an erasure request removes and when. All amounts are EUR in whole cents, with no VAT.
For each hold, the document names the failure it prevents. Negative case: a reviewer picks any requirement or constraint in this brief and finds it in the document, and finds no rule in the document that the client did not state. Where the brief is silent, the document says so and marks the choice as yours.
Architectural guidance
Rules kept in someone's head get applied differently by whoever writes the hold, whoever writes the refund and whoever answers the erasure request. The first difference shows up as a unit sold twice or a refund that is a cent off, long after its cause. Writing each hold with its end, and the failure it prevents, is how the later Phases get something to be wrong against.
Acceptance criteria
From a fresh clone, one command starts the whole shop and the simulator, and the reviewer reaches a response from the shop's front door. The simulator moves the clock the shop reads forward by 15 minutes, by 24 hours and by 14 days, and after each move reports the shop's current time in ISO 8601 in UTC.
The README gets a reviewer from a fresh clone to an order shipped in two parcels, delivered, partly returned and refunded in 15 minutes, and states that target here. It lists the command that runs each test this brief asks for and names the Phase that adds it, with the tests that do not exist yet marked as coming. It also lists the outside failures the simulator can cause so far, and each later Phase adds to that list.
Negative case: running the command a second time from a clean state gives the same result, and running it twice without cleaning does not leave two shops answering.
Architectural guidance
A shop that takes an afternoon to start does not get run by a reviewer, and one that cannot move its clock cannot show a 15-minute hold ending or a 7-day authorisation lapsing without waiting for them. The later Phases pose failures that have to be caused on purpose, and a simulated day in which nothing can be made to go wrong proves nothing about the shop. If starting depends on what the last run left behind, a failure found on one day cannot be reproduced on the next.
Architectural walkthrough
How a home-goods retailer sells from three warehouses
The retailer sells 18,000 products through one online shop and keeps them in three warehouses, WH1, WH2 and WH3. It takes about 4,000 orders a day, and 600 an hour at peak. A merchandiser publishes, changes and withdraws products. A shopper searches the catalogue and sees each product as in stock or out of stock.
At checkout the shop sets aside the stock for the shopper and authorises the card, and it charges the card when the goods ship. An order can hold items from different warehouses. The shop then ships it as separate parcels, one from each warehouse, and the order shows as partly shipped until the last one goes. A picker in a warehouse takes the items off the shelves for each order.
Warehouse operators receive stock, correct counts and move stock between warehouses. A shopper can return items for 14 days after the last parcel arrives. The warehouse inspects what comes back and a refund goes to the card. A card refund reaches the shopper 5 to 10 business days later, and the client's payment contract keeps the fee from the original charge.
The words this brief uses:
Reservation: stock set aside for one shopper at checkout, for 15 minutes.
Authorisation: the card's bank agreeing to pay and setting the amount aside, up to 7 days, without moving it yet.
Capture: taking the authorised money, which the shop does when the goods ship.
Order line: one product, with a quantity, on an order.
Pick and short pick: taking an order line's items off the shelf, and the case where the picker cannot find them.
Transfer: moving stock from one warehouse to another. The units cannot be sold until the receiving warehouse has them.
Shelf check: counting what a shelf really holds, which can lead to a correction of the stock number.
Return window: the 14 calendar days after the last parcel is delivered in which a shopper may return items.
Write-off: removing returned items that cannot go back on sale from the stock.
Refund: money returned to the card. It can never be more than was captured.
Why the rules come first
A team that starts coding before the client's rules are written down finds the gaps one at a time, in production. Shipping and discount are shared by guesswork, so one order's lines add up to the order total and the next order's lines are a cent over. A hold on stock has no stated end, so a unit stays promised to a shopper who left an hour ago. Nobody has decided what an erasure request may remove, so the first one is answered by whoever is on duty.
Each gap comes back later as a cent that does not add up or a unit nobody owns. A cent of difference is invisible on one order. Across 4,000 orders a day, finance finds it at month end and reconciles by hand, which is the work this shop is meant to end.
The client's rules also reach across the whole product. A refund for a returned bowl depends on how shipping was shared when the order was placed, and a short pick depends on the same shares. When the rule exists in two heads, the two answers differ by a cent, and each is right by the head that produced it.
A product that cannot be started the same way twice has a related cost. If a reviewer needs an afternoon to reach a first response, nobody runs the simulated day, and the failures the later Phases pose are never caused on purpose.
Publish products and count stock
Produces the merchandiser's product publishing with history and the warehouse operators' stock counts, corrections and transfers. Leaves reservations, search and ordering for later.
Acceptance criteria
A merchandiser publishes a product with variants, each with a SKU, a price in cents and attributes, then changes it, withdraws it and lists it again. The product's history shows each change with who made it and when, and any earlier revision can be read back exactly as it was. A withdrawn product cannot be bought and is not shown to shoppers.
Negative case: two merchandisers change the same product at the same moment. Both changes appear in the history, in an order the history states, and neither is lost silently. A price of zero or below is refused and changes nothing. A run with the 18,000 SKUs the client sells publishes them all and reads back one earlier revision from the middle of the history.
Architectural guidance
A product edit that overwrites the last one leaves support unable to say why a price changed or who changed it. When two merchandisers edit at the same moment, the shop either keeps one change and drops the other without telling anyone, or shows a product that neither of them wrote. Either way the shopper sees a price the client cannot explain.
Acceptance criteria
An operator receives stock for a SKU into WH1, WH2 or WH3, and the count for that SKU in that warehouse rises by the quantity, in whole units. Every change to a count is visible to an operator as a dated entry that says what happened, by whom and why, and the count always equals the sum of those entries.
Negative case: a receipt of zero or a negative quantity is refused and changes nothing. The same receipt sent twice with the same reference counts once, and the second answer says it was already recorded. A receipt for a SKU that does not exist is refused with the SKU named.
Architectural guidance
A receipt that arrives twice because a warehouse tablet lost its connection and tried again puts units on the screen that were never delivered. Nobody notices until a shopper is promised one of them and a picker cannot find it. A visible entry for each change is how an operator later finds out which receipt was the extra one.
Acceptance criteria
After a shelf check, an operator sets the count for a SKU in a warehouse to the number found. The difference is recorded with a reason: shelf count, damaged or lost. The entry shows the old count, the new count and the reason, and the operator sees the new count at once.
Negative case: a correction that would take a count below zero is refused and changes nothing. A correction to the number already held changes nothing and is not counted as a loss or a gain.
Architectural guidance
A shelf check finds that the screen was wrong, and how that is recorded decides whether anyone can later tell why. A correction with no reason cannot be told from a theft, a breakage or a miscount, and the client deals with each differently. A correction that silently allows a negative count lets the shop promise units that do not exist.
Acceptance criteria
An operator dispatches units of a SKU from one warehouse to another. The units leave the source warehouse's count at dispatch and join the destination's count only when an operator records receipt. While they are in transit they are sellable nowhere, and an operator can see which transfers are in transit and since when.
Negative case: dispatching more than the source holds is refused and changes nothing. Recording receipt of the same transfer twice adds the units once. Recording receipt of a transfer that was never dispatched is refused.
Architectural guidance
Units on a truck between WH1 and WH2 are in neither building. A receipt recorded twice puts units on the screen that were only ever delivered once.
Acceptance criteria
A test runs with one command the README lists. It makes many simultaneous changes to one SKU in one warehouse, a mix of receipts, corrections and dispatches, with the number of simultaneous writers stated in the README and high enough that several of them reach the same count at the same moment. When it finishes, the count equals the sum of the recorded changes, and it never went below zero in any reading the test took along the way.
The test repeats with the process killed partway, several times, and restarted each time. After each restart no change is half applied: every change is fully in the count and in the history, or in neither, and no change appears twice.
Negative case: a change that was refused leaves no trace in the count or the history. The test is shown to fail when a deliberate fault is added, such as a change that alters the count without being recorded.
Architectural guidance
Two operators change the same count in the same moment, and one change overwrites the other. The shop then promises units that are not on the shelf or hides units that are. A process that stops between a change and its record leaves the count and the history disagreeing from then on, so nobody can tell later which of the two to trust.
Architectural walkthrough
Stock counts are the shop's first promise to a shopper, and several people change them at once. Two operators receive stock for the same SKU in the same second, and one receipt disappears from the count. Nobody sees it until a picker finds fewer units on the shelf than the screen shows. A count that cannot be explained by what happened cannot be corrected either, because nobody knows which change was wrong.
A product edit has the same cost on a smaller scale. A merchandiser changes a price, a colleague changes the description a moment later, and one of the two changes is gone with no sign of who made it. Support then argues with a shopper about a price nobody can reproduce.
A transfer between warehouses goes wrong in the most expensive way. Units that have left WH1 and not reached WH2 are on a truck. If the shop counts them in both warehouses, two shoppers are promised the same unit. If it counts them in neither once they have arrived, sellable stock disappears for no reason. Receiving the same transfer twice puts units on the screen that were never on a shelf.
A process that stops between a change and its record is the quietest failure. The count moved and the history did not, or the other way round, and the two disagree from then on. Every later Phase trusts these counts, so an error here is paid for in oversold orders.
Reserve stock with a deadline
Produces holds on stock for shoppers: allocation across the three warehouses, a 15-minute deadline, safety stock, moves when a count drops or a warehouse goes quiet, and the 200-buyer proof. Leaves committing a hold to the Phase that confirms orders.
Acceptance criteria
Your repository holds a document that shows the client's allocation rule applied by hand to a mix of orders the document states, with 2.1 lines per order on average and none above 8 lines, over stated stock in WH1, WH2 and WH3. The rule is fewest parcels first. If one online warehouse can fill the whole basket, the basket comes from it. If none can, the shop takes from the warehouse that covers the most requested units, then from the online warehouse with the most remaining stock for what is left. Ties go to the lower warehouse code. A line may be split across warehouses, and the shopper cannot choose.
For every order the document shows the parcels the rule makes. You then apply a most-stock-first rule to the same mix and compare the two by parcels per order, with totals. The document ends by confirming fewest parcels first as the client's rule and says how many parcels the comparison saved.
Negative case: the mix includes at least one order that needs a split line, at least one tie that goes to the lower warehouse code, and at least one order that cannot be filled at all and is shown as refused.
Architectural guidance
Fewest parcels first sounds obvious until stock is spread thin: a rule that picks the warehouse with the most stock splits a basket that one warehouse could have filled. Each extra parcel is a second delivery the client pays for and a second wait for the shopper. Counting a mix by hand first gives the checks that follow something to be wrong against.
Acceptance criteria
Asking to hold a basket of SKUs and quantities is answered either with held until a stated time, 15 minutes later, and the warehouse each unit comes from, or with refused and the reason: not enough stock, or no warehouse online. The warehouses follow the client's allocation rule, and the basket is held whole or not at all.
A hold that is neither confirmed nor released ends by itself at the stated time, and its units are sellable again. Asking to hold for the same order twice, including twice at the same moment, returns the same hold and holds the units once. Until checkout exists, the simulator asks for holds in a way you choose.
Negative case: a refused basket holds nothing, not even the lines that could have been held. A basket with 8 lines where the 8th cannot be filled leaves the first 7 lines sellable.
Architectural guidance
A hold that ends only when someone remembers to release it keeps units off sale for shoppers who have gone home. Holding the lines that fit and refusing the rest leaves a shopper with a partial basket they did not ask for and stock locked behind it. A request sent twice by a front end that timed out must not hold the units twice, or the shop locks up twice the stock it sells.
Acceptance criteria
Safety stock of 2 units per SKU per warehouse by default, overridable per SKU and warehouse, is never offered to shoppers. A SKU is in stock when its sellable units are above zero: units on hand, minus units held for shoppers, minus units held for confirmed orders, minus safety stock, over the warehouses that are online. An operator or the simulator can read whether a SKU is in stock or out of stock, and the change from one to the other is visible when a hold, a receipt or a correction causes it. Units in transit count nowhere.
Negative case: with 2 units on hand and a safety stock of 2, a request to hold 1 is refused. A SKU with an override of 0 in one warehouse offers all its units from there, and a SKU with an override of 5 offers none until 6 are on hand.
Architectural guidance
Safety stock exists because counts are wrong by a unit or two: a picker finds a damaged item, a shelf check finds a miscount. Selling down to zero turns the first such mistake into a cancelled order. A SKU shown as in stock when its only units are protected or in transit sends shoppers to checkout for a refusal.
Acceptance criteria
When a correction leaves a warehouse with fewer units than are held there for orders, the holds move to other warehouses, unconfirmed holds first and the youngest first within each group, then confirmed ones. A hold that cannot move is released. If it belonged to an unconfirmed order, that order is cancelled with the reason stock gone. If it belonged to a confirmed order, that line is cancelled with the reason stock gone. The shopper's order shows which, in plain words.
Negative case: a count drop that fits inside the units not held moves nothing and cancels nothing. A drop that needs to move holds to a warehouse that is itself short moves what fits and cancels the rest, and no hold ends up in a warehouse that cannot supply it.
Architectural guidance
When the count falls short of the holds, three shoppers have paid for units that are not on the shelf, and the picker is the one who finds out. Which shopper loses the unit is the client's decision, and an arbitrary choice cancels the order of a shopper who has already paid before one who has not.
Acceptance criteria
The simulator sends a sign of life for each warehouse. A warehouse with no sign of life for 5 minutes on the simulated clock is offline. It is left out of new holds, its unconfirmed holds move as they do in a count drop, and its confirmed holds stay where they are and ship when the warehouse is back. When a sign of life arrives again, the warehouse is used for new holds again.
Negative case: a warehouse quiet for 4 minutes stays in use, and one quiet for 5 minutes is out. A basket that only the offline warehouse could fill is refused and holds nothing.
Architectural guidance
A warehouse that has lost power still shows its stock. If the shop keeps assigning orders to it, shoppers pay for parcels that nobody is there to pick. Treating a warehouse as gone after a short blip moves holds around for nothing, which is why the client has chosen 5 minutes.
Acceptance criteria
A test runs with one command the README lists. 10 sellable units are spread across the three warehouses, and 200 buyers each ask for 1 unit at the same moment. Exactly 10 holds succeed and 190 are refused. No count goes negative and no order holds twice.
The run is repeated with every request sent a second time, and ends the same: still exactly 10 holds. A third run kills the process partway through, restarts it and lets the remaining buyers finish. At the end exactly 10 units are held and every refused buyer was told so.
Negative case: the test prints the number of holds it found, and it is shown to fail, with a number above 10, when a deliberate fault is added to the shop.
Architectural guidance
This is the stand mixer incident at a larger scale. Two shoppers asking in the same millisecond are both told yes if the shop checks the stock and then holds it as two separate acts. The client finds out when a picker cannot find the 11th unit, and the shopper hears it by email after paying. A front end that sends each request twice, and a process that stops halfway, cause the same mistake in two more ways.
Architectural walkthrough
This Phase is the stand mixer incident. The old shop checked the stock count when a page opened and never again, so it accepted 112 orders in 20 minutes for 40 units. Two shoppers were told yes for the last unit, and the second order was found out only when a picker could not pick it. The client cancelled 72 orders by email and refunded 72 cards by hand.
Stock held for a shopper is unsellable to everyone else. A shopper closes the tab, a payment never reports back, or a warehouse stops answering, and the hold stays on the shelf for a sale that never happens. About 30% of checkouts are abandoned at payment, so even a 15-minute hold keeps units off sale all day.
Counts change under holds. An operator finds 3 units where the screen said 8, while 6 are promised to shoppers. If the shop does nothing, three shoppers have paid for units that are not there. A warehouse that goes quiet is the same problem at a larger scale: its holds may be good or may not, and orders keep arriving.
The shop also has to decide where a basket comes from. A basket that one warehouse could fill but ships in two parcels costs the client a second delivery for no reason, and the shopper cannot choose. How the shop decides is the client's rule, and the Phase starts by working it out by hand.
Each of these costs the client a cancellation, a refund fee the provider does not return and a shopper who may not come back.
Search the catalog
Produces search by name, category and attribute with an in-stock label, and proof that search catches up after crashes, outages and a bulk price change. Leaves ordering to later Phases and never lets search decide an order.
Acceptance criteria
A shopper searches by name, category and attribute and gets matching products with their price in cents and their variants. A product published a moment ago appears. A withdrawn product never appears. Search works over the 18,000 products the client sells.
Negative case: a search for a term nothing matches returns an empty list with a message that nothing matched, not an error.
Architectural guidance
A shopper who searches for a stand mixer and finds nothing leaves, and one who finds a withdrawn product arrives at a checkout that refuses them. Search is how 18,000 products reach shoppers, so a product missing from it is a product the shop cannot sell. A search that fails on a term nothing matches turns every typo into an error page.
Acceptance criteria
Each result shows each variant as in stock or out of stock, using the client's definition of sellable units. A sell-out, a receipt and a hold that runs out each reach search within 10 seconds at the 95th percentile when they are single changes. The measurement covers a number of changes the README states, and the measured 95th percentile is printed.
Negative case: what search shows never decides an order. With search still showing a SKU in stock after its last unit is held, a request to hold it is refused. With search still showing a SKU out of stock after a receipt, a request to hold it succeeds.
Architectural guidance
Shoppers chased stock that was gone and the client answered their emails. The 10 seconds is the client's number, and it is a promise about the busy day, not the quiet one. A label on a search result that is allowed to decide an order will sell what the stock count has already given away.
Acceptance criteria
A test kills the process right after a product change is saved and right after a stock change is saved, restarts it, and shows that search catches up with each change exactly once. It repeats with the kill at several different points between the save and the moment the change is visible in search, and the README states how many points it tries.
Negative case: after search has caught up, repeating the catch-up does not show the change twice and does not bring back an earlier value over a later one. After every run, search compared against the catalog and the stock counts shows no difference.
Architectural guidance
A process can die between saving a price change and telling search about it. When it does, search shows the old price until the product is next touched, and nothing fails and nothing is logged. Nobody finds out until a shopper reaches checkout at a different price. A catch-up after the restart that is careless can also bring back a value that has since changed.
Acceptance criteria
With search stopped, a shopper's basket can still be held and the stock counts stay right. The test stops search, holds baskets, then starts search again. Search catches up with everything that changed while it was stopped without any manual step: every product shows its current price and every SKU its current in-stock label, and a comparison against the catalog and the stock counts finds no difference. The README adds placing and paying for an order to this test in the Phases that build them.
Negative case: while search is stopped, nothing a shopper does to buy fails, and the shop never answers a shopper with an error about search.
Architectural guidance
A page for browsing must not be able to stop sales. If a slow or stopped search makes the shop slow or refuse shoppers, a fault in search turns into shoppers who cannot buy. During a promotion, when search is under the most load, that is the worst moment to find out.
Acceptance criteria
A merchandiser changes the price of all 18,000 products at once. An operator then empties search completely and asks it to be rebuilt. When the rebuild ends, every product shows its current price and every SKU its current in-stock label, and a comparison against the catalog and the stock counts finds no difference. While the rebuild runs, shoppers can still hold stock and the shop answers them.
Negative case: a price change and a stock change made while the rebuild runs are not lost, and both are visible in search when it finishes. A bulk change only has to converge, so the test does not hold it to the 10-second figure, and it prints how long convergence took.
Architectural guidance
A bulk price change leaves search wrong for every product at once, and the rebuild that fixes it takes time. A change made during that time is easily lost, because the rebuild started before the change and does not know about it. The shopper sees a price the client changed an hour ago, and support cannot tell which price is current.
Architectural walkthrough
Search is the page shoppers see first and the page that is wrong first. After the stand mixer sold out, search kept showing it in stock for an hour, and shoppers chased stock that was gone. After a price change, a result that shows yesterday's price sends the shopper to a checkout where the price is different. A change saved just before a crash that never reaches search is the quietest version: nothing fails, and the product stays wrong until someone notices.
The opposite failure costs more. If search is slow, stopped or being updated and shoppers cannot order, a fault on a page for browsing has stopped the shop's sales. Search must never decide whether an order can go ahead. What it shows is a hint, and the stock count is the answer.
A bulk change makes both worse. A merchandiser changing the price of all 18,000 products at once leaves search wrong for every product until it catches up. A rebuild that runs during the change can lose what changed while it ran.
Take payment
Produces a stand-in payment provider that misbehaves on demand, the authorisation of a card payment including extra authentication and abandonment, and a payment that ends in the right place however the provider's messages arrive. Leaves the charge and refunds for the Phases that need them.
Acceptance criteria
A stand-in payment provider the shop can be started against, built however you like, that can be made to cause each of these behaviours on demand: approve a payment, decline it, report insufficient funds, ask the shopper for extra authentication and then succeed or fail, charge once for an authorisation (a second charge is refused), void an authorisation, refund (a refund above the charged amount is refused), renew an authorisation, drop an authorisation 7 days after it was made, and send a notice about every change. It can also be told to repeat, delay or reorder those notices, and to answer every request with a failure. Refunds settle after a delay on the simulator clock that stands for 5 to 10 business days.
Shoppers present a reference to a payment method and never a card number, and the stand-in never receives one. A test runs with one command the README lists and shows each behaviour being caused on demand, with the outcome the shop sees. The README states how to cause each behaviour.
Negative case: a second charge for the same authorisation and a refund above the charged amount are each refused, and the test shows both.
Architectural guidance
A shop that has only met a provider that always answers once, quickly and in order has never been tested. A real provider cannot be made to fail on demand, so every failure the shop must survive has to be caused by something the client controls. A stand-in that behaves too nicely produces a shop that is first tested by shoppers.
Acceptance criteria
The provider's notices that are repeated, arrive late or arrive out of order never move a payment backwards and never act twice. A late notice about an earlier state that arrives after a later one changes nothing. A repeated notice changes nothing. A notice that does not carry the provider's proof that it came from the provider is refused and changes nothing. Notices the provider keeps retrying for up to 3 days are accepted whenever they arrive.
Negative case: a payment that has reached a finished state, such as declined or voided, is never moved back to an earlier one by a late notice. The shopper sees one state at a time, in plain words: waiting for payment, waiting for the shopper to authenticate, authorised, declined, voided.
Architectural guidance
The provider says things twice because it retries until it hears back, for up to 3 days. It says things in the wrong order because messages cross. A shop that trusts the last message it received marks a declined payment as authorised, or a voided one as live, and finance finds the difference later. A shop that accepts a notice from anyone who sends one can be told that an order has been paid.
Acceptance criteria
A test runs with one command the README lists. It runs payments down every path (approve, decline, insufficient funds, authentication then success, authentication then failure, abandon) while the stand-in repeats, delays and reorders its notices in every combination the test generates, and the README states how many combinations that is. Each payment ends in the one state its path demands, and no payment is authorised twice at the provider.
Negative case: the test prints a count of payments in a wrong state or authorised twice, which is 0, and it is shown to report a non-zero count when the shop is deliberately broken.
Architectural guidance
A shop that survives the three scrambled orderings someone thought of has proved little about the fourth. Messages cross in production in any order and in any number, and the one that breaks a payment is the one nobody tried. It is found by a shopper who was charged for a cancelled order.
Architectural walkthrough
Three words matter in this Phase. An authorisation is the card issuer's promise to hold an amount for the shop. A charge, also called a capture, is the shop taking that money. A refund gives money back to the card. This Phase deals with authorisation only.
The payment provider is outside the shop, and it behaves like the outside world. It answers twice, answers late, answers out of order or does not answer at all. A shopper whose payment timed out presses the button again, and a retry that authorises a second time holds the same money twice on their card. A payment shown as failed that the provider authorised a moment later leaves a shopper holding money for an order the shop cancelled.
Some payments stop and wait. A bank may ask the shopper to confirm on their phone, and for minutes, or for good, nothing happens. The order cannot be confirmed or cancelled yet, and the stock held for it has a deadline.
The cost lands on the client. A shopper whose card holds money for a cancelled order writes to support, and the money comes back when the authorisation lapses or the provider releases it. A provider notice that is accepted from anyone who sends it lets a stranger mark orders as paid. The shop must also never see a card number, because anything that stores or logs one puts card data in places the client never meant to protect.
A real provider does not fail on demand, so this Phase starts by building a stand-in that does, and the checks that follow find out what the shop does when it misbehaves.
Place an order
Produces checkout at a fixed price, an order confirmed only when stock is held and the card is authorised, the release of everything when payment fails or the shopper leaves, and proof that no failure leaves stock or money held. Leaves shipping for later.
Acceptance criteria
A shopper's basket, with a customer reference, name, email, delivery address, lines of SKU and quantity, and the discount and shipping amounts it is given, starts a checkout. Each line is priced at the catalog's price at that moment, in cents, and keeps that price. A later price change in the catalog never changes the price of that checkout.
Negative case: a price change made between starting the checkout and placing the order leaves the shopper's price as it was. A basket with a withdrawn or unknown SKU is refused and names the line. A basket with a quantity of zero or below is refused.
Architectural guidance
Prices change while shoppers are checking out, because a merchandiser can change the price of all 18,000 products at once. The price the shopper agreed to is the price of the order.
Acceptance criteria
A payment declined, an authentication that failed or was abandoned, a shopper who leaves, and a payment provider that is down each end the same way. The stock is released, the order is cancelled with a reason the shopper can read (payment failed, or hold ran out), and no authorisation is left live at the provider. Where it applies, the shopper is told to try again. When the provider is down, the shop keeps trying until the hold's deadline at 15 minutes, then releases the stock.
With payment stopped, search and the stock counts still work and shoppers can still start checkouts. About 30% of checkouts in the simulated day are abandoned at payment, and after the clock passes the 15-minute deadline none of them holds stock.
Negative case: a shopper who authenticates after the deadline is not confirmed, and their authorisation is voided.
Architectural guidance
About 30% of checkouts, around 1,700 a day, end at payment without a sale. Each one that does not give its stock back keeps units off sale until someone notices, and during a promotion that is the unit the next shopper wanted. A provider that stops answering turns every checkout in progress into one of them at the same moment.
Acceptance criteria
A test sends the same place-order request, with the same Idempotency-Key header, many times at the same moment and again after a pause, and the README states how many times. It produces one order, one hold on stock and one authorisation, and every caller gets the same answer. A different key with the same basket makes a second order, with its own hold and its own authorisation.
Negative case: the same key sent with a different basket is refused with a message that the key was used for a different request, and it creates nothing.
Architectural guidance
A shopper double-clicks, or the front end times out and tries again, and the shop makes two orders. Two requests that arrive in the same moment are the case that slips past a check made with requests sent one after the other.
Acceptance criteria
A test injects each failure at each step of placing an order: the provider down, a decline, a shopper who leaves, a hold running out, and the process killed between two steps of placing an order. After each run it moves the simulator clock past 15 minutes and then past 7 days. It then checks, against the stock counts and the stand-in provider and not through the order view, that no hold on stock and no authorisation is left live for an order that is not confirmed, that no order is half confirmed, and that each confirmed order has exactly one hold and one authorisation.
The README states how many runs the test makes per failure and step, and the test prints a count of violations, which is 0. Negative case: killing and restarting the process doubles nothing, so there is no second hold and no second authorisation. The test is shown to report violations when a deliberate fault is added.
Architectural guidance
The failures that matter here do not arrive one at a time and do not announce themselves. A process stopped between two steps leaves stock held for an order nobody will confirm, or money held with no order behind it, and both look fine on the order screen. Looking at the stock counts and the provider directly finds what the order view cannot. About 30% of checkouts end at payment, so the paths this test covers are the ones production runs most.
Architectural walkthrough
An order is several steps that all have to happen or none: hold the stock, authorise the card, confirm. A process that dies between two of them leaves a card authorised for an order whose hold ran out, or stock held for a payment that failed. Neither is visible to the shopper until the stock is missing or the money is. The client pays for it in shoppers whose money is held for nothing and in units locked for nobody.
The front end adds its own failure. It sends the same order twice because a shopper double-clicked, or because a request timed out and it tried again. If the shop makes two orders, the shopper pays twice and the second order is a refund waiting to happen, on which the provider keeps its fee. Two requests that arrive in the same moment are the hardest version.
The payment provider can stop answering while shoppers are checking out. About 30% of checkouts are abandoned at payment anyway, so a shopper who left and a provider that is silent look alike from the shop's side. Both must end with the stock back on sale after the 15-minute deadline.
A price that changes while a shopper is checking out is a smaller failure with the same cost. A shopper who saw 49.99 EUR and is charged 54.99 EUR writes to support, and one who is charged less costs the client the difference.
Fulfil from three warehouses
Produces one pick list per warehouse, picking, packing, shipping and delivery with a stand-in carrier, the short-pick answer, one charge at the first shipment and the handling of a card authorisation that cannot be renewed. Leaves cancels and returns for later.
Acceptance criteria
Once an order is confirmed, each warehouse that holds part of it has a pick list showing only that warehouse's lines and quantities. An order held entirely in WH1 has one pick list. An order held in WH1 and WH2 has two, and a line split across them appears on both with the quantity from each, adding up to the quantity ordered.
A warehouse operator sees the open pick lists of their own warehouse and no other. With the warehouse tools stopped when an order is confirmed, shoppers can still order and pay, and the pick lists appear once the tools return.
Negative cases: an order that was cancelled before it was confirmed has no pick list. Confirming the same order twice, or killing the process right after the confirmation, ends with exactly one pick list per warehouse and none missing. An order that is placed but not yet confirmed has none.
Architectural guidance
A picker works in one building, so a list that mixes warehouses cannot be picked. If lists are made before the stock is guaranteed to the order, a warehouse walks the aisles for an order the shop may still cancel, and the client pays for the labour. A process that dies right after confirming can leave a confirmed order with no list at all, and nobody notices until the shopper asks where it is.
Acceptance criteria
An operator picks, packs and ships a pick list, which produces one parcel. The order shows partly shipped after the first parcel, shipped once every parcel has shipped and delivered once the stand-in carrier has reported every parcel delivered. The simulator sets the delay before each delivery report, and times shown are ISO 8601 in UTC.
With the warehouse tools stopped, shoppers can still search, order and pay, and the pick lists appear when the tools return.
Negative cases: a delivery report sent twice leaves the parcel delivered once and the order unchanged. A delivery report that arrives before the parcel is recorded as shipped does not make an unshipped parcel delivered. A delivery report for a parcel that does not exist is refused.
Architectural guidance
A carrier reports in its own order and sometimes twice. If a repeated report is counted twice, an order shows delivered while a parcel is still on a shelf, and the shopper's return window ends early. If one stopped part of the shop halts the whole warehouse floor, orders keep arriving with nobody to pick them.
Acceptance criteria
An operator reports that a line on a pick list could not be found. The shop looks for another online warehouse with available stock for the missing quantity. If one has it, the quantity appears on that warehouse's pick list. If none has it, the line is cancelled, the shopper's order says the line was cancelled because the stock was gone, and the money for the line is taken off the coming charge if nothing has been charged yet, or refunded if it has. There is no backorder.
A refund after the charge settles in 5 to 10 business days on the simulator's clock, and the provider keeps its fee on it. A simulated day with 1% of lines short-picked ends with every one of them answered one of these two ways.
Negative cases: reporting the same short pick twice moves the quantity once or refunds once. A short pick for more units than the line holds is refused. When the warehouse that took the quantity cannot find it either, the same question is asked again and the line is cancelled once no warehouse is left.
Architectural guidance
A shelf count is never exact, and about one line in a hundred is short-picked. A short pick reported twice that refunds twice pays out for the same missing item twice, and each refund costs a provider fee.
Acceptance criteria
The card is charged once for the whole order, when the first parcel ships, for the authorised amount minus the value of lines already cancelled. When every line was cancelled before then, the authorisation is voided and nothing is charged. Shipping a second parcel charges nothing more. A line cancelled before the charge lowers it, and a line cancelled after is refunded.
Negative cases: killing the process after the parcel is recorded as shipped and before the charge is asked for still ends, once the process is back, with exactly one charge for the right amount. The same charge requested many times at the same moment charges once. Nothing is ever charged on a lapsed authorisation.
Architectural guidance
Charging at the first shipment opens a gap: a process that dies between the shipment and the charge leaves a parcel with no money behind it, and the shortfall surfaces when finance reconciles. A charge sent twice either takes the shopper's money twice or is refused and then misread as a failed payment.
Acceptance criteria
A test that the README lists by command builds this in one run: a split order over WH1 and WH2 where one line is short-picked and ends cancelled, one parcel shipped and charged, and a second order whose authorisation lapses with nothing charged. It ends with stock counts, money (charged, refunded, voided) and the order view agreeing line by line, with no hold on stock and no live authorisation left. The test prints its figures.
The run is repeated twice: once with the carrier reporting every delivery twice, once with the process killed once between recording the first shipment and the charge. All three runs end with identical figures. Negative case: when the test is made to charge one cent too much, it fails and names the order and line.
Architectural guidance
The wrong figures appear when they overlap: a refund sized from the wrong charged amount, or a cancel that frees stock a parcel already took. Only a check of money and stock for every line, after the worst ordering of failures, finds them. A check that each step finished does not.
Architectural walkthrough
A split order ships as two parcels, and the card is charged once for the whole order, when the first parcel ships. The provider allows one charge per authorisation. If the shop tries to charge at each parcel, the second charge is refused and the shop may read that refusal as a failed payment. If it charges at neither, parcels leave with no money behind them. The charge waits for the first shipment because the provider keeps its processing fee on every refund, and a charge at order time would turn every short pick and every cancel into a refund with a fee.
The dangerous moments sit between steps. A process that dies after a parcel is recorded as shipped and before the charge is asked for leaves a parcel in a van with nothing paid, and nobody finds out until finance reconciles. A carrier that reports the same delivery twice, or reports it before shipping is recorded, can mark an order delivered while a parcel is still in the warehouse, and the 14-day return window then ends too early.
About one line in a hundred cannot be found on the shelf. If the shop does nothing, the shopper waits for an item that is not coming. If the shop cancels at once, the client loses a sale another warehouse could have made. If the cancel comes after the charge, the refund costs a provider fee on money the client held for a few hours.
A card authorisation lapses 7 days after it was made. A slow warehouse can still be picking on day 8, and a parcel shipped against a lapsed authorisation is a parcel given away. Renewing without limit is no safer: it holds the shopper's credit for an order nobody ships. Short picks, partial shipments and lapses each look correct alone. The wrong figures appear where they overlap, such as a refund sized from the wrong charged amount or a cancel that frees stock a parcel already took, and the last Checkpoint of the Phase is there to find those.
Cancel, refund and erase
Produces the order view, cancels before picking, refunds capped by what was charged, erasure of personal data and the finance proof that every order's money adds up. Leaves returns for later.
Acceptance criteria
A shopper or a support agent looks up an order and sees its lines, its payment in plain words (waiting for payment, authorised, charged, refunded, refund pending or refund failed), its parcels with shipped and delivered times in ISO 8601 UTC, its cancelled lines with the reason, and its refunds with reason and time. A shopper sees only orders they placed. A support agent sees any order.
With payment stopped, the page still loads, shows everything else, and says the payment state is not available right now. It does not show a payment state it cannot confirm as if it were current.
Negative cases: an order number the viewer did not place is not shown to a shopper, and the answer does not reveal whether the order exists. After a line is cancelled for stock gone, the page says so in the shopper's words.
Architectural guidance
Shoppers and support agents ask the same question: where is my order and where is my money. If the page needs every part of the shop to be running, a payment outage also blinds support at the moment shoppers ask the most. A page that shows a payment state it cannot confirm leads an agent to promise a refund that is not coming.
Acceptance criteria
A shopper or a support agent cancels an order or one line before the pick list holding it has been started. The stock is released, and the money for what was cancelled is returned in full: voided if nothing was charged, refunded if the card was charged. The cancelled amount for a line is the line total from the rules worked out in the Phase 1 document, and it is never billed again.
Once picking has started on the pick list, the cancel is refused and nothing changes. Cancelling the same line twice at the same moment cancels and refunds once. A cancel racing with a pick ends with exactly one of the two: the line is either cancelled and never packed, or picked and the cancel refused.
Negative case: the test for the race runs many times, and no run ends with a line both cancelled and shipped.
Architectural guidance
A cancel and a pick can arrive in the same second. If both succeed, the warehouse packs a parcel for an order the shopper was told is cancelled, and the client refunds money for goods it also shipped. A cancel sent twice that refunds twice pays the shopper twice, and the provider keeps its fee on each refund.
Acceptance criteria
Every refund has a reason (shopper, support, stock gone, goodwill) and appears in the finance report as pending before the provider has answered. A refund asked for just before the process is killed still appears, and ends settled or failed once the process is back. A refund that would take settled plus pending refunds above the amount charged is refused, and the order view and the finance report say so. A goodwill refund is capped the same way. Refunds go only to the original payment, and a request for another destination is refused.
A refund settles 5 to 10 business days after it is asked for, on the simulator's clock. A refund the provider rejects shows to the shopper as owed, appears in the finance report as needing a manual payout, and does not count against the cap.
Negative cases: asking for the same refund twice refunds once. A provider notice that a refund settled, repeated, late or before the notice of an earlier step, settles it once and never turns a settled refund into a failed one.
Architectural guidance
A refund above the amount paid is money out of the door that the client rarely gets back. A shopper told that a refund is done while the provider rejected it files a complaint two weeks later. A refund request cut off halfway leaves nobody knowing whether money moved. A rejected refund that still counts against the cap blocks the payout the shopper is owed.
Acceptance criteria
On a shopper's request, name and email are erased or replaced with a stand-in value at once. The GDPR allows one month to answer an erasure request, so at once is the client's own stricter policy. The delivery address is erased once the order is closed: every parcel delivered or cancelled, the order's 14-day return window over, no return open, and no refund pending or failed. For an order whose last parcel was delivered on 3 Nov 2026, the window is over from 18 Nov 2026, 00:00 Europe/Amsterdam (17 Nov 2026, 23:00 UTC), and not before. A reviewer moves the simulator clock to show each condition.
Orders, payments, refunds, returns and stock records are never deleted and stay identified by ID. The finance report shows the same totals before and after the erasure. The erased fields appear nowhere a client's staff or partner can see them: not in the order view, search, the finance report, the logs or the operator's trace. Dutch law makes the client keep these records for 7 years, so they stay for that period; deleting them afterwards is outside this brief.
Negative cases: a request for an order still being delivered erases name and email and keeps the address until the last parcel is delivered or cancelled, then erases it. A later step of the same order, such as a delivery report or a refund settling, does not bring an erased field back.
Architectural guidance
The client must keep its order and payment records for 7 years under Dutch law and must also honour the request. Deleting the order loses what finance needs. Leaving a name or address in a place nobody cleans, such as a search entry, an exported finance file or a log, is the usual leak. A step that runs after the request and writes the old value back undoes the erasure without anyone noticing.
Acceptance criteria
A test that the README lists by command runs a simulated set of orders through shipping, cancels and refunds. For every order, the amount charged minus the amount refunded equals the value of the lines the shopper kept, and no order has refunds above what was charged. The test is run again with the provider's notices repeated and the process killed once, and the figures do not change.
The finance report lists each order's money, the refunds with their reasons, and the refunds owed to shoppers that need a manual payout. Negative case: the test is shown failing against a deliberately wrong refund and names the order.
Architectural guidance
Money errors are small and spread out. A cent of rounding on a shipping share or a refund counted twice after a retry looks fine on the one order someone checks. Finance finds the difference by hand, order by order. A check that compares charged, refunded and kept for every order, under repeats and a crash, is the only one that catches them before month end.
Architectural walkthrough
Money moves backwards in this Phase, and every step has a way to move too much. A refund above what was charged is cash the client rarely recovers. A cancel that arrives while a parcel is being packed can let the warehouse ship goods the shopper was told were cancelled, and the client then refunds an order it also delivered. A cancel clicked twice by an impatient shopper pays the shopper twice.
The payment provider is slow and sometimes refuses. A shopper told on screen that a refund is done, while the provider rejects it, phones a week later asking where the money is. The provider keeps its fee on every refund and settles 5 to 10 business days after the request, so an avoidable refund costs money and a wrong refund costs more.
A shopper can ask for personal data to be erased. The client must still keep its orders, payments, refunds, returns and stock records. Deleting the order destroys what finance needs. Leaving a name in a search entry, a finance export or a log keeps data the shopper asked to remove, and the client finds out when the shopper complains.
Without a proof, finance reconciles by hand. A cent of rounding on a shipping share or a refund counted twice after a retry is invisible on one order and shows up across 4,000 orders a day as a difference nobody can place.
Take returns back
Produces return requests inside the 14-day window, processing at the warehouse, refunds with a share of shipping and discount, and proof that each return restocks and refunds once. Leaves operations for later.
Acceptance criteria
A shopper requests a return for lines of a delivered parcel. The request is accepted only if it is made no later than 23:59:59 Europe/Amsterdam time on the 14th calendar day after the day the last parcel of the order was delivered, the same end for every line of the order, the quantity does not exceed what was delivered minus what is already returned or in a return, and the line was not cancelled. The window is checked when the request is made, and the request holds no stock and no money.
A single-parcel order is delivered on Tue 3 Nov 2026 at 10:00 Amsterdam time. A request 13 days and 23 hours later (17 Nov 2026, 09:00) is accepted, and so is one 14 days and 1 hour later (17 Nov 2026, 11:00) and one at 17 Nov 2026, 23:30, but a request at 18 Nov 2026, 00:30 is refused with the reason. A two-parcel order has its first parcel delivered on 3 Nov 2026 at 10:00 and its second on Fri 6 Nov 2026 at 15:00. Every line's window ends at 20 Nov 2026, 23:59:59, so a request for a first-parcel line at 19 Nov 2026, 10:00, 16 days after it arrived, is accepted, and at 21 Nov 2026, 00:30 it is refused, as is one for a second-parcel line. While one parcel is undelivered, the delivered lines can be returned. A parcel with every line cancelled does not count as a parcel of the order. A request for a line of a parcel that has not been delivered, for a cancelled line, or for more units than are left to return is refused with the reason and changes nothing.
Negative cases: the same return requested twice at the same moment makes one return. An erasure request while a return is open erases name and email, and keeps the delivery address until the return is finished.
Architectural guidance
The window decides who gets refunded. Counted from the order date it punishes shoppers whose second parcel came late. Counted from each line's own parcel it closes on the first parcel's lines before the shopper has seen the whole order, which is shorter than the 14 days the client promised. Counted from the request it never ends. Two clicks on the return button that create two returns double every step that follows.
Acceptance criteria
An operator records a return as received and then inspects each line as put back on the shelf or written off. Put-back units rejoin the stock count of the warehouse where the operator recorded the return, once. Written-off units add nothing to the count. The order view shows the return as requested, received and inspected.
Negative cases: recording the same inspection twice restocks once. Inspecting a line that is not in the return, or more units than the return holds, is refused and changes nothing. Recording the receipt of a return that was never requested is refused.
Architectural guidance
A returned bowl put back twice leaves two bowls on the count and one on the shelf. The next shopper's order is accepted, the picker cannot find the bowl, and a short pick starts the whole story of Phase 7 again. The returns tablet resends on a bad connection, so repeats are normal and not rare.
Acceptance criteria
A test that the README lists by command covers returns of every kind: units put back, units written off, part of a line, two returns of one order. It reports the inspection many times, requests the refund many times, and has the provider's notices repeated, late and out of order. Every return restocks exactly once and refunds exactly once, and the order's money adds up as in Phase 8.
The test is run again with the process killed once between recording an inspection and the refund. The figures are identical. Negative case: when the test is made to restock a return twice, it fails and names the return. The 320 returns of the final trading day run through the same checks.
Architectural guidance
Returns touch stock and money in one flow, and either half can be repeated. The shelf shows a repeat as a unit that is not there. The provider's statement shows it as a second refund with a fee. Each is easy to miss in a test that sends every message once, in order, with no crash.
Architectural walkthrough
About 8% of orders come back, which is 320 returns in the simulated day. At that volume a small mistake repeats hundreds of times. A return refunded twice pays the shopper for goods the client also got back. A bowl put back on the shelf twice leaves the count one higher than the shelf, so the next order for it is accepted and the picker cannot find the second bowl.
The window ends 14 calendar days after the last parcel of the order is delivered, on the same day for every line. A window counted from the order date punishes the shopper whose second parcel arrived late, and one counted from each line's own parcel closes on the first parcel's lines before the shopper has seen the whole order. A return accepted for a line that was never delivered, or for more units than were delivered, refunds goods the shopper never had.
Refunds do not divide evenly. A line of three units with a share of shipping and a share of discount has a total that three equal rounded amounts do not add up to. A refund a cent too high or too low per unit shows up across 320 returns as a difference finance must explain. The tablet at the returns desk resends on a bad connection, and the provider repeats its notices, so every step must give the same result when it is told twice.
Operate the shop
Produces the operator's abilities: tracing one order, setting aside a step that keeps failing, restoring a stale order view and updating one part of the shop while orders keep flowing. Leaves the load target and the full trading day for the last Phase.
Acceptance criteria
An operator gives an order number and sees every step the order went through, from every part of the shop, in time order, with what was decided and why. This works for any order of the simulated day. Times are ISO 8601 in UTC, and steps with the same time come out in the same order every time.
For the order the README walks through, shipped in two parcels, delivered, partly returned and refunded, the trace shows each step with the step that caused it.
Negative cases: tracing an order that does not exist says so. A step that was retried appears once. With one part of the shop stopped, the trace still lists the rest and names the part it could not reach.
Architectural guidance
A support question is always about one order, and the answer is scattered across everything that touched it. Without a trail an agent guesses. A trail that lists a retried step twice, or silently leaves out a part that was stopped, sends the agent to the wrong conclusion and the shopper gets the wrong answer.
Acceptance criteria
An order step that fails 5 times in a row is set aside. An operator sees what the step was, why it failed and which order it affects. The other orders keep flowing: a test with one step that always fails among many orders ends with every other order complete. After the cause is fixed, the operator retries the step and it completes once.
Negative cases: a step that fails 4 times and then succeeds is not set aside. A step set aside and retried twice completes once. A step set aside is still set aside after the process restarts. The order the step belongs to shows the shopper a state that is true, and not one that implies the step is done.
Architectural guidance
An order whose follow-up step always fails can block every order behind it, or be dropped and take a charge or a refund with it. A retry that runs the step twice pays or charges twice.
Acceptance criteria
An operator can list the orders whose view shows something other than what happened to their payment, parcels and refunds. When many orders are wrong at once, for example after a long outage, one action corrects all of them, and afterwards every order's view matches what happened. While it runs, orders keep arriving and none is lost.
Negative cases: running the action twice gives the same views. A payment or carrier notice repeated or late while it runs does not leave an order showing a state it has already left.
Architectural guidance
Nobody notices a wrong view until a shopper says so. When the only fix is editing orders one by one, the client cannot say how many are wrong or whether the fix is finished.
Acceptance criteria
While a load of orders flows at a rate the test states, no lower than 300 orders an hour (half the peak hour), one part of the shop at a time is updated to a new version and restarted: payment taking, search, the warehouse tools and returns. Shoppers keep searching and holding stock throughout. Every order placed during a restart ends confirmed or cancelled with a reason the shopper can read. No order is lost or doubled, and no unit is sold twice.
The test lists the orders that arrived during each restart and what became of each. Negative case: the test is shown failing when an order placed during a restart disappears.
Architectural guidance
An update that drops the requests arriving during a restart loses orders the shopper thinks were placed, or places them twice when the shopper presses buy again.
Architectural walkthrough
The shop works when everything goes right, and an operator is the person who deals with the rest. A support agent asks why one order has no refund. If the answer is spread across everything that touched the order, the agent guesses, and a wrong guess costs a refund or an apology.
One order step that always fails can block every order waiting behind it. Dropping it loses a charge or a refund nobody knows is owed, and a dropped step looks like health because nothing shows red. The client finds out when a shopper asks where the refund is.
The order view shows what happened to an order. A view that is wrong tells a shopper that an order shipped yesterday is waiting for payment, which brings a support call and sometimes a second order. When the only fix is editing orders by hand, the client cannot say how many are wrong.
A release in the middle of the day is a release in the middle of orders. An update that drops the requests arriving while a part restarts loses orders the shopper believes were placed, or places them twice when the shopper presses buy again. If the client cannot update safely during the day, every fix waits for the night and the shop goes down for everyone to fix one part.
Survive a trading day
Produces the failure plan, a peak-hour load proof and the final simulated trading day with every failure at once. Adds no shop behaviour.
Acceptance criteria
A written plan in your repository, committed before the trading day is run, lists every failure the day will inject: the payment provider offline for longer than 15 minutes, its notices repeated and out of order, the carrier reporting twice, a warehouse quiet for more than 5 minutes, search stopped, a bulk price change, one part of the shop killed and restarted, and one part updated. For each failure it states when it starts and ends in the simulated day and the outcome the client should see, in the client's terms: what the shopper sees, what happens to holds and authorisations, what finance sees.
At least one window has the provider outage, a restart and a quiet warehouse overlapping, and the plan states the outcome for that window too. Negative case: a failure with no stated outcome, or an outcome that says only that nothing breaks, does not count.
Architectural guidance
Failures in a trading day do not wait their turn. They start while an earlier one is still running. If the expectation is written after the run, the run's result becomes the expectation and a lost order gets explained away.
Acceptance criteria
A test that the README lists by command sends orders at the peak rate for a simulated hour: 600 confirmed orders, 2.1 lines per order on average and up to 8, with about 30% of checkouts abandoned at payment. Every order is either confirmed or refused with a reason, and none is lost or doubled. Search shows a change within 10 seconds at the 95th percentile on single changes during the hour.
One SKU with 10 sellable units is asked for by 200 buyers inside the hour, and exactly 10 orders for it are confirmed. The report states the rate achieved, and the test fails if it is lower than 600 orders in the hour. Negative case: no unit is sold twice and no hold or authorisation is live for an order that is not confirmed 20 minutes after the last order.
Architectural guidance
The peak hour is where the slow part shows. Holds wait on each other, search lags so a sold-out item still shows in stock, and orders time out so the shopper presses buy again. Each of these looks fine at a few orders a minute. At 10 a minute the client sees the stand mixer incident return on its busiest hour.
Acceptance criteria
The simulated trading day runs with every failure in the plan happening in the same day: 4,000 confirmed orders from about 5,700 checkouts, a peak hour of 600 orders, 320 returns, 30% of checkouts abandoned at payment and 1% of lines short-picked. The results show when each failure began and ended, and a failure from the plan that did not happen fails the run.
At the end of the day no hold on stock and no authorisation is live for an order that is not confirmed, every order's money adds up, every count equals its recorded changes, search agrees with the stock for every SKU, and every step set aside has an explanation. While the payment provider was offline, shoppers could still search, the order view still loaded and warehouses still shipped paid orders. The results are committed to your repository.
Architectural guidance
Parts tested one at a time hide the faults that appear when failures overlap. A reviewer should trust the totals at the end of the day, such as money, counts, holds and search, and not the absence of errors during it. A day that ends with a hold nobody released or a refund nobody can place is a day the client would have found out about from shoppers.
Architectural walkthrough
The shop passes each test and still fails on the busiest day, because the failures overlap. A payment outage that lasts longer than the 15-minute hold, while one part of the shop is being updated and a warehouse has gone quiet, leaves holds, authorisations and half-confirmed orders that no single test produced.
The cost lands on the client in the peak hour: 600 orders, about 10 a minute, each one a shopper deciding whether to wait. A slow part shows up there first. Sold-out stock still shows in stock, shoppers press buy twice, and the stand mixer incident of 40 units and 112 accepted orders happens again.
A plan written after the run explains the result. A plan written before it can be wrong, which is the point of writing it first. The overlap that hurts the client is the one nobody wrote down.
Architectural walkthrough
One unit, one buyer
The old shop checked the stock count when a page loaded and never again. Between that check and the payment, it accepted 112 orders for 40 stand mixers. The retailer cancelled 72 orders by email and refunded 72 cards by hand, and because a refund shows on a card 5 to 10 business days later, customers kept writing for two weeks asking where their money was. Each oversold unit costs a cancellation, a refund fee that the provider does not return, and a customer who may not come back. The last-unit test reproduces the incident at a larger scale: 200 buyers, 10 units, and exactly 10 of them get one.
Holds that never end
Stock held for one shopper is unsellable to everyone else. A shopper who closes the tab, a payment that never reports back and a payment provider that is offline all leave a hold that nobody releases. About 30% of checkouts are abandoned at payment, which is about 1,700 a day, so even a 15-minute hold keeps stock off the shelf for a sale that never happens. A hold with no end turns a popular item into one that nobody can buy and nobody owns.
The card has the same problem on a longer clock. The provider drops a card authorisation after 7 days. A parcel that ships on day 8 against an authorisation that lapsed on day 7 is a parcel nobody paid for.
One order, four hits
Take an order for a stand mixer, a lid and two bowls, with a shipping charge and a discount. Four things happen to it.
Split. The mixer and the bowls are in WH1 and the lid is in WH2, so two parcels leave on different days. The shopper must be charged once and shown a partly shipped order. A shop that charges per parcel bills the shipping twice, and one that charges when nobody is looking bills nothing.
Slow warehouse. WH2 is slow, and on day 6 the card authorisation is a day from lapsing. If nothing renews it, WH1's parcel ships on day 8 with no money behind it.
Short pick. The picker in WH2 cannot find the lid. The shopper has to hear about it and must not pay for it. The refund settles 5 to 10 business days later and the provider keeps its fee on it, so every line that was charged and then cancelled costs the retailer money.
Return. The shopper sends back one bowl a few days after delivery. The refund is the bowl's price plus its share of shipping and discount. A refund paid twice, or a bowl put back on the shelf twice, leaves the books wrong by the price of a bowl.
Pick one order from your own trading day and check that stock, money and what the shopper was told agree about every unit, every line and every cent.
What the outside world does
The payment provider sends the same message twice, sends a later message before an earlier one, answers after 30 seconds, or does not answer at all. A process dies between saving an order and the next thing that should have happened to it. Two requests for the last unit arrive in the same millisecond. A carrier reports a delivery twice. A merchandiser changes the price of every product while shoppers are searching.
Each of these costs the client money or trust in a different way: a customer charged twice, a unit sold twice, a parcel that never ships, a search page that shows a price from yesterday. The trading day at the end of the project makes all of them happen in the same simulated day, because they do not arrive one at a time.
Where it shows if you cut a corner
If two buyers can both be told yes for the last unit, the 200-buyer test sells an eleventh unit. If a refund is sized from the order's total and not from what was captured, the money test finds an order where captured minus refunded does not equal the lines the shopper kept. If a hold has no end, the trading day finds a reservation or an authorisation still live after the payment provider's outage ended. If stopping search stops orders, or an update to payment drops the orders that arrive during it, the shop has the same weakness the old one had, in a different place.
Related Links
- Your Europe, consumer rightsthe 14-day right to withdraw from an online purchase, which the client adopts as its return window and states as its own policy, counted from the delivery of the last parcel of an order delivered in parts.
- ECB, revised Payment Services Directivewhy a card payment can stop and wait for the shopper to authenticate.
- GDPR Article 17, right to erasurewhy an erasure request still leaves the records a legal obligation requires, which is the shape of the erasure rule in this brief.