Build a Ticket Shop for a Small Music Venue
A small music venue sold 311 standing tickets for a floor that holds 300 when a gig went on presale at 10:00. You will build the replacement ticket shop, from publishing a gig through ticket holds and payment to admission at the door, and prove with a simulated presale that no ticket is sold twice and every payment ends in a ticket or a refund, even when the payment provider is late, repeats itself or sends messages out of order.
The brief
The client
I run a music venue with a 300-person standing floor and a 50-seat balcony, and we put on about 120 gigs a year. Tickets sell through a page on our own website that checks how many are left, saves the booking in a second step, and sends the buyer to a payment link. When a sold-out gig went on presale at 10:00, about 500 fans hit the page in the first minute, two of them were told at 10:00:04 that they had the last two standing tickets, and by lunchtime we had sold 311 standing tickets for a floor that holds 300. The page also gave a buyer's tickets back after 10 minutes, so nine people who were still approving the payment in their banking app paid for tickets we had already sold again.
I refunded all 11 by hand in the payment dashboard and phoned the ones I could not reach before doors. I need the last ticket to go to exactly one fan, a payment that finishes late to be settled by a written rule, and a way to check before doors that every payment ended in a ticket or a refund.
The problem
The booking page decides whether tickets are free in one step and records the booking in another, so two requests that arrive together can both pass the first step. A hold on tickets and the payment for them run on separate clocks. The hold lasts 10 minutes, and a payment can finish after it, because the buyer's bank approval takes an unpredictable time and the payment provider's confirmation message can arrive late, twice, or in a different order than the events happened. Nothing today says what should happen when a payment lands on tickets that were already resold, so the answer depends on which page code ran last.
The venue cannot see this before it costs money. Tickets, bookings and payments live in one spreadsheet-shaped table that the booking page, the payment link and the door staff all write to. After a cancelled gig the manager refunds each buyer by hand, and a refund that is clicked twice is a second refund. The sold-out gig cost 11 refunds, a morning of apology calls and a touring band that watched a full house turn people away.
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 staff publish a gig with several ticket types, each with a capacity, prices that change on a date and a sales window, all given in the venue's local time and read correctly across a clock change.
- Let the public list upcoming gigs by date and see how many tickets of each type are left.
- Hold tickets for a buyer for 10 minutes, never sell more than a ticket type's capacity however many buyers ask at the same moment, and give back the tickets of an abandoned checkout.
- Show the all-in price, including the booking fee of 150 cents a ticket, before the buyer pays, and charge exactly that amount, with a bank approval step when the bank requires it.
- Settle a payment that finishes after its hold ended by a written rule: the buyer gets the tickets if enough are still free, and otherwise the whole amount goes back.
- Handle a provider message that arrives twice, late or out of order without selling a ticket twice or keeping money for no ticket.
- Issue ticket codes that cannot be forged, and admit each ticket once at the door, including when two scanners read it at the same moment.
- Cancel a gig and refund every order for it exactly once, even when a refund fails or the process dies halfway.
- Erase a buyer's name and email on request after the gig has happened, keeping orders, payments and tickets identified by ID.
- Check with one command that no ticket type has sold more than its capacity and that every successful payment ended in tickets or a refund.
Deliverables
- Your repository starts the product and the payment provider you build with one documented command.
- A README that takes a reviewer from a fresh clone to a bought ticket admitted at the door in 20 minutes, and lists the command for each test.
- API documentation for what staff and the public send and receive: publishing a gig, quotes, orders, order status and cancelling a gig.
- A guide for the people who build the door scanners: what a scanner sends, what it gets back and every reason a scan is refused.
- A description of how a payment provider reports a payment to the product and how the product answers it.
- A test suite that includes tests which really run at the same moment, plus the results of the simulated presale from the final Phase committed to your repository.
- A way to run the venue's presale faster than real time and to cause the outside failures the brief names: a payment that finishes late, a message sent twice or out of order, a refund that fails once, a killed process and two scanners reading one code. It works in local and test environments only.
- An operations note: what an operator can do after a crash to finish anything left half done, how to retry a refund that failed, and how to read the check command.
Out of scope
- A fair queue, presale codes and a metered admission rate. A 350-ticket gig does not need a waiting room, and queue design is the subject of Build an Event Ticketing Platform, the next step up.
- A limit on how many tickets one buyer can take across orders. A cap of 4 tickets of one ticket type in a single order is enough here.
- Numbered seats and seat maps. The floor is standing, and a seat choice adds geometry the race does not need.
- Changing a ticket type's capacity after it is published. It would move a number that holds already depend on.
- Dynamic pricing, resale and ticket transfer. Each needs a rule this brief does not fix, and none changes the race.
- Payouts to touring bands, ledgers and disputes. The venue pays acts by hand from a report.
- Real payments and card data. You build a payment provider of your own, and the product never stores or logs a card number.
- Rotating ticket codes and door work without a network. A scanner that cannot reach the product admits nobody.
- Buyer accounts and logins, a front end, tax and more than one currency. A buyer is an email address, the product has no front end, and every amount is in euros.
Architectural constraints
- A ticket type never has more tickets held and sold than its capacity, however many buyers ask at the same moment.
- A hold lasts 600 seconds and is live only strictly before its end. The answer for a late payment never depends on whether the tickets of an ended hold have shown as free yet.
- A quote is valid for 600 seconds, and the amount charged is exactly the amount quoted. Amounts are whole cents in euros.
- A payment that finishes after its hold ended gets the tickets if enough are still free at that moment, and otherwise the whole amount goes back, booking fee included. A refused payment stays refused.
- Messages from the payment provider are judged by when the provider says things happened and never by when they arrived. A repeated message changes nothing, and an older message that arrives later changes nothing.
- Every successful payment ends in tickets or one full refund. No buyer is repaid twice, whatever is retried or killed.
- A process killed at any moment loses no paid order and doubles no ticket, email or refund.
- No card number is ever stored or logged.
- Staff enter times in the venue's local time, Europe/Amsterdam, and the product reads them correctly on every day of the year. A local time that does not exist or happens twice is refused.
- The payment provider is sent an order reference and an amount, never a buyer's name or email.
- A buyer's name and email are erased on request once the gig has happened, while orders, payments, refunds and tickets stay, identified by ID. Dutch tax rules oblige the venue to keep its business records for 7 years, so those records stay for 7 years, and that duty is the client's own.
Prerequisites
You have built one application with a database on your own, and you can write a test suite for it. Any language and framework works. You do not need payments knowledge, and you do not need to know how a music venue sells tickets to a gig; the first Phase explains the business and the words the brief uses, and each Checkpoint explains the problem it checks. The race tests send several requests at the same moment to your running product, so you need to run it on your own machine the way it really runs, not as a stand-in that handles one request at a time. The beginner project Build a Box Office for a Village Hall Show covers the same domain at a smaller size and is not required.
Free to start. An account is what keeps track of the checkpoints you finish.
Work out the rules by hand
Produces two worked documents: the sale times and prices of one gig across a clock change, and who keeps the tickets when a payment lands late. No product code yet.
Acceptance criteria
You write a document in your repository with the sale times and prices of the example gig worked out by hand. Each answer is shown as a calculation and not copied from a program. The example is Harbour Lights on Saturday 12 Jun 2027 at 20:00 in Europe/Amsterdam, with Standing (capacity 300; 2200 cents from Sunday 21 Mar 2027 at 10:00 local, then 2500 cents from Sunday 28 Mar 2027 at 10:00 local) and Balcony (capacity 50; 3500 cents from 21 Mar 2027 at 10:00 local). The booking fee is 150 cents a ticket.
- The document gives the UTC instant of each of these local times: 10:00 on 21 Mar 2027, 10:00 on Saturday 27 Mar 2027, 10:00 on Sunday 28 Mar 2027 and the gig's 20:00 start. It states that the two Standing prices start 6 days and 23 hours apart and not 7 days.
- It names the local times that do not exist or happen twice around the clock changes, with 02:30 on 28 Mar 2027 and 02:30 on 31 Oct 2027 as the two examples, and says what the product does when staff type one: refuse it and name the field.
- It states whether a sale is open at the exact opening instant and at the exact closing instant, and that the close defaults to the gig's start.
- It lists the all-in price a buyer sees for 2 Standing tickets at 21 Mar 2027, 09:30 UTC, at 28 Mar 2027, 07:59:59 UTC and at 28 Mar 2027, 08:00 UTC, and for 1 and 4 Balcony tickets. The answers are 4700, 4700 and 5300 cents for Standing, and 3650 and 14600 cents for Balcony.
- It states the client's limits: 1 to 4 tickets of one ticket type in one order, and at most 350 tickets across all ticket types of one gig.
Architectural guidance
A price that changes an hour late on the day the clocks change sells an hour of tickets at the wrong price to the busiest crowd of the year. An opening that lands an hour early or late is worse, because 500 fans arrive at the page at the same moment. Working the dates by hand shows which instants are in doubt before a program hides the doubt, and gives every later time check an answer you wrote yourself.
Acceptance criteria
You write a document in your repository with the client's rule for a payment that finishes after its hold ended, and a table of worked cases. The rule is the client's: a payment that finishes after its hold ended gets the tickets if enough are still free at that moment, and otherwise the whole amount goes back, booking fee included. You restate the rule in your own words in the document and fill in the cases the rule leaves open.
The cases use a ticket type with capacity 4, a hold of 2 tickets taken at 10:00:00 that lasts 600 seconds, and an order of 4700 cents. For each case the table shows who has the tickets afterwards, what the buyer sees, how many tickets are left for other buyers and what money moves.
- The payment finishes at 10:04:00.
- The payment finishes at 10:09:59, and at exactly 10:10:00. A hold is live only strictly before its end.
- The payment finishes at 10:11:00 and nobody else bought anything.
- The payment finishes at 10:11:00 after another buyer took 3 of the 4 tickets, and again after another buyer took 2.
- The payment finishes at 10:11:00 and is refused. At 10:15:00 tickets become free and the same message is delivered again. A refused payment stays refused.
- The provider's message that the payment succeeded is delivered twice.
- The provider's message that the payment failed arrives after the message that it succeeded, although the failure happened first.
- The provider reports a failure at 10:03:00 and a success at 10:03:05, in that order.
Architectural guidance
A hold ends on our clock and a payment finishes on the provider's clock, and they disagree whenever the buyer's bank approval outlasts 600 seconds. With no written answer, the buyer with the late payment and the buyer who took the same tickets 30 seconds later each believe they own them, and the client finds out at the door. A table of cases written before any code shows where the rule is silent, such as the exact second a hold ends.
Architectural walkthrough
How a music venue sells tickets to a gig
The client runs a music venue with a 300-person standing floor and a 50-seat balcony. It puts on about 120 gigs a year. A gig has several ticket types, such as standing and balcony, and each type has its own capacity, price and sales window. Tickets go on sale at a set time, called a presale, and a popular gig sells out within minutes. At the last sold-out gig, about 500 fans hit the page in the first minute.
A fan picks tickets and the page holds them for 10 minutes while the fan pays. The price shown includes a booking fee of 150 cents a ticket, since a seller has to include unavoidable costs in the displayed price (the Dutch consumer regulator ACM said so in 2017). The fan pays through a payment provider, and the bank may ask the fan to approve the payment in a banking app. That approval takes as long as the fan takes. The provider then sends the venue a message that the payment finished, which can arrive late, twice or out of order.
A paid order becomes tickets with codes. At the door, staff scan each ticket once. If a gig is cancelled, every buyer is refunded. The venue refunds by hand in the payment provider's dashboard today.
The words this brief uses:
Gig: one event at the venue.
Ticket type: a kind of ticket for a gig, such as standing or balcony, with its own capacity and price.
Capacity: the most tickets of a type the venue may sell.
Presale: the sales window that opens a gig for buyers, here at 10:00 local time.
Hold: tickets kept for a buyer for 10 minutes while the buyer pays.
Booking fee: the 150 cents a ticket added to the price.
Bank approval: the buyer's confirmation of a payment in their banking app.
Provider message: the payment provider's report that a payment finished.
Door scan: staff reading a ticket's code at entry.
Why the two questions come first
The old booking page had no written rule for two questions, so the answer to each depended on which code ran last.
The first question is what a time means. Presale opens at 10:00, and 10:00 is a different instant in winter and in summer. On Sunday 28 Mar 2027 the clocks go forward at 02:00, so a price change planned for 7 days after the opening arrives at 11:00 local if someone adds 168 hours, and at 10:00 if someone adds 7 calendar days. For that extra hour the venue sells at the old price to whoever is on the page, and nobody notices until a buyer quotes the difference.
The second question is who keeps the tickets when a payment finishes after the 10-minute hold has ended. The buyer's bank approval takes as long as the buyer takes. On the sold-out gig nine buyers approved a payment after their tickets had been sold again. The client refunded all 11 oversold buyers by hand and phoned the ones it could not reach before doors.
You work both out by hand first because every later Checkpoint takes a number or a rule from these two documents. A Checkpoint built against a rule nobody wrote down has an answer you cannot check.
Put gigs on sale
Produces gigs that staff publish with ticket types, prices that change on a date and sales windows read in the venue's local time, and a public listing that shows how many tickets are left. Holds and selling come in the next Phase.
Acceptance criteria
Staff publish a gig with a request that carries a secret shared with the venue's staff. How the request carries it is yours, and the API documentation says how. The body holds a show title, the start as a local date and time with the venue's IANA time zone name, and one or more ticket types. Each ticket type has a name, a capacity and a list of price tiers, each tier with a local start and a unit price in whole cents.
The example gig is show "Harbour Lights", starting 12 Jun 2027, 20:00 in Europe/Amsterdam, with Standing (capacity 300, tiers 2200 cents from 21 Mar 2027, 10:00 and 2500 cents from 28 Mar 2027, 10:00) and Balcony (capacity 50, one tier of 3500 cents from 21 Mar 2027, 10:00). The request returns the gig's ID and the IDs of its two ticket types. A request for the gig by that ID shows the title, the start as the UTC instant 12 Jun 2027, 18:00 UTC and as local time, and the two ticket types with their names and price tiers.
Each of these is refused and leaves nothing behind that staff or the public can see: a missing or wrong staff secret; no ticket types; a capacity of 0 or less; a unit price of 0, below 0 or with cents that are not a whole number; two capacities that add up to 351 or more (301 Standing and 50 Balcony); a start in the past, judged by the product's clock; an unknown zone name such as Europe/Amsterdm; tiers whose starts do not strictly increase; and two ticket types with the same name in one gig. A request with one valid ticket type and one invalid one publishes neither.
The public listing of gigs shows only gigs that start after the current time, ordered by start, each with the show title, the start as a UTC instant and as local time, and the ticket type names. With the clock moved past the example gig's start, the list is empty. A request for one gig by an ID that does not exist is refused as not found.
Architectural guidance
A gig with half its ticket types published is worse than no gig, because the half that exists sells and the other half is missing from a show the client announced. A start given only as a local time can be read two ways, and a reader that picks the other way shows a fan the wrong start time on the day of the gig.
Acceptance criteria
Each ticket type has a sales window, an opening and a closing, which staff give as local date and times in the gig's time zone. The window is open at the opening instant and closed at the closing instant, so a buyer at exactly the close is too late. The close defaults to the gig's start and cannot be later. The first price tier starts at the opening.
Tests can set the time the product works by, so they do not wait for the clock. The control works in local and test environments only and is documented in the README. Every later Phase uses it.
Two dates are checked against the clock change. 10:00 local on Saturday 27 Mar 2027 is 27 Mar 2027, 09:00 UTC. 10:00 local on Sunday 28 Mar 2027, the day the clocks go forward, is 28 Mar 2027, 08:00 UTC. The example Standing tiers (2200 cents from Sunday 21 Mar 2027 at 10:00 local, 2500 cents from Sunday 28 Mar 2027 at 10:00 local) therefore start 21 Mar 2027, 09:00 UTC and 28 Mar 2027, 08:00 UTC, which are 6 days and 23 hours apart, not 7 days.
With the time set to 21 Mar 2027, 08:59:59 UTC the public view of the gig shows the Standing ticket type as not yet on sale. At 09:00:00Z it shows the sale as open with a price of 2200 cents. At 28 Mar 2027, 07:59:59 UTC the price is still 2200, and at 08:00:00Z it is 2500. At the gig's start it shows the sale as closed. Outside the window the view reports "not on sale" and shows no price.
A local time that does not exist is refused, for example 02:30 on 28 Mar 2027, when the clocks jump from 02:00 to 03:00. A local time that happens twice is refused, for example 02:30 on 31 Oct 2027, when the clocks go back from 03:00 to 02:00. Both refusals name the field and leave nothing behind, for the gig's start as well as for windows and tiers. A window that closes before it opens, a first tier that does not start at the opening, and a close later than the gig's start are refused.
Architectural guidance
Adding 7 times 24 hours to a winter-time opening puts the second tier at 11:00 local on the day the clocks change, so the price rises an hour late. Refusing a time that does not exist or happens twice is cheaper than guessing, because a wrong guess opens the presale an hour early or late for 500 fans at once. Tests that wait for real time cannot reach a date in March, so tests need a way to move the product's time.
Acceptance criteria
The public listing and the public view of a gig show, for each ticket type, how many tickets are left. A newly published ticket type shows its full capacity. The examples use the Harbour Lights gig.
- Within 1 minute of publishing the example gig, the listing shows 300 tickets left for Standing and 50 for Balcony.
- Publishing is all or nothing. When a failure is forced at the end of a publish (the README says how), no gig appears, no ticket type shows tickets, and nothing appears later after a restart or a retry.
- The process is killed at each moment of a publish that you can tell apart, and restarted. A gig that appears in the listing afterwards shows 300 and 50 tickets left within 2 minutes, and no gig stays listed without tickets. The README says what an operator runs, if anything, and it is at most one command.
- Restarting the product any number of times, and running the operator's command from the README any number of times, leaves exactly 300 and 50. The count never becomes 600 and 100.
Architectural guidance
A gig that is published but has no tickets looks published to staff and empty to the public, and the client learns about it from a fan. A repair that runs twice puts the tickets on sale twice, which shows 600 tickets for a floor of 300. A repair that resets the count after buyers took tickets gives away tickets that are already held. The README note matters because the same crash will happen on the day of a presale, when nobody has time to work it out.
Architectural walkthrough
Two things go wrong before a single ticket is sold. The first is time. Staff type local times, and the product has to read them the way staff meant them on every day of the year, including the day the clocks change. A sale that opens an hour early or a price that rises an hour late hits all 500 fans at once.
The second is a process that dies in the middle of publishing.
The Phase ends with a published gig that shows exactly its capacity on the public listing, however many times the process died and restarted on the way.
Hold and sell tickets
Produces holds that give a buyer 10 minutes with the tickets, tickets that return when a hold runs out, a rule for a payment that finishes after its hold, and tests that race buyers for the last ticket. Checkout and payment come in later Phases, so tests drive this Phase through ways you document.
Acceptance criteria
The product holds tickets of one ticket type for an order reference. A hold lasts 600 seconds from the moment it is taken. The README documents the way tests ask for a hold. The answer gives a hold ID and the instant the hold ends. The examples use the Standing ticket type with capacity 300.
- Holding 2 tickets returns the hold ID and its end. The public view of the gig then shows 298 tickets left.
- With 1 ticket left, a request for 2 is refused as sold out and changes nothing: the view still shows 1 left and no hold exists for it. A request for 1 then succeeds and leaves 0 left.
- Two requests for the last ticket, sent by separate clients at the same moment, end with one hold and one refusal.
- Repeating a request with the same order reference, one after another or from separate clients at the same moment, returns the same hold and counts the tickets once.
- A quantity of 0, a negative quantity, a fractional quantity and a ticket type that does not exist are each refused and change nothing.
- Restarting the product any number of times leaves the count at 298 while the hold exists.
Architectural guidance
A product that checks how many tickets are left and saves the hold a moment later lets two requests both see the last ticket. That gap sold the client 311 tickets for a floor of 300, and it opens wider the more fans arrive in the same minute. A buyer who asked for 2 and got 1 is a second problem: the refusal has to be all or nothing, so nobody pays for half an order.
Acceptance criteria
When a hold ends, its tickets return to the buyers who are waiting. A hold is live only strictly before its end instant, so it is over at that instant and after it. The examples use a ticket type with capacity 4, and a hold of 2 tickets taken at 10:00:00 that ends at 10:10:00. Time is set by the control from Phase 2.
- At 10:09:59 the public view still shows 2 tickets left. At 10:11:00 it shows 4 left, and a new buyer can hold all 4.
- The 2 tickets come back once: the view shows 4 left, never 6, however often it is read and however many requests arrive at the same moment.
- A hold that was paid for is never given back. With the payment reported at 10:04:00 (the README documents how), the view shows 2 left at 10:11:00 and for good.
- With capacity 2, a hold of 2 leaves 0 left. At 10:11:00 the same buyer can hold 2 again.
- The process is killed at some moment between 10:10:00 and 10:11:00 and restarted. At 10:11:00 the view shows 4 left, never 6 and never 2.
Architectural guidance
A hold that never ends makes a gig look sold out when it is not, and 500 fans in the first minute can park a whole floor behind abandoned checkouts. Giving the same tickets back twice does the opposite: it shows more tickets left than the floor holds, and the next buyers are sold tickets that do not exist. The answer to whether a hold is still live has to come from the time it ends, so the same question gets the same answer at any moment.
Acceptance criteria
The README documents a way for tests to report that the payment for a hold finished, until payments exist. The report answers in plain words that the tickets are the buyer's, or that the payment is refused for lack of tickets. The rule is the client's from Phase 1. The examples use capacity 4 and holds of 2, with a hold H1 taken at 10:00:00 that ends at 10:10:00.
- Reported at 10:04:00, while H1 is live, the tickets are the buyer's. The public view shows 2 tickets left for good.
- Reported at 10:11:00 when nobody else bought anything, the tickets are still the buyer's. The view shows 2 left.
- Reported at 10:11:00 after another buyer took 3 tickets, the payment is refused, because 1 ticket is left and 2 are needed. No count changes.
- Reported at 10:11:00 after another buyer took 2 tickets, 2 are left, so the tickets are the buyer's.
- A refused payment is all or nothing: with 1 ticket left, a payment for 2 does not sell 1.
- The same report made again returns the same answer and changes nothing, including after a refusal when tickets have since become free.
- The answer at 10:11:00 is the same whether or not anyone read the public view between 10:10:00 and 10:11:00.
- Several clients reporting the same payment at the same moment sell the tickets once.
- A report for a hold that does not exist is refused as an error.
Architectural guidance
If the answer depends on which code ran last, two buyers can each be told the same tickets are theirs, and the client finds out at the door. Money for tickets that nobody is holding has to either become tickets or go back in full, never stay in between.
Acceptance criteria
The test suite contains tests that really run at the same moment: separate clients send their requests to the running product in parallel. A test where requests wait their turn one after another does not count. The README says how to run them. Each test ends by reading the public view and the check command's output.
- Last ticket: with 1 ticket left, many clients each ask for 1 at the same moment. Exactly 1 succeeds, all the others are refused, 0 tickets are left and one hold exists.
- Odd leftover: capacity 5, and enough clients each ask for 2 to ask for more than 5 in all. Exactly 2 succeed, the rest are refused, 1 ticket is left and no partial hold exists.
- Bigger crowd: capacity 50 (the Balcony), and enough clients each ask for 2 to ask for more than 50 in all. Exactly 25 succeed and the rest are refused.
- Same reference: several clients use one order reference. One hold exists and the tickets are counted once.
- Same payment: several clients report one payment for a live hold at once. The tickets are sold once.
- A check command prints, for each ticket type, its capacity, the tickets held and the tickets sold. It exits non-zero when a ticket type has more tickets held and sold than its capacity, or when the tickets left in the public view differ from capacity minus the tickets held and sold. Each test runs it at the end. Phase 6 extends it.
The README records a run of a deliberately broken version that checks how many tickets are left, pauses 50 milliseconds and then saves the hold. The last-ticket test fails on it with more than one hold, and the README shows that output next to a run of the real product. The suite passes repeated runs in a row.
Architectural guidance
A race test earns trust only after it has failed against the bug it guards, because a test that has never failed may not be racing anything. The odd-leftover case matters as much as the last-ticket case: a request for 2 when 1 remains is where a product that only asks whether anything is left sells half an order. A failure that shows up on some runs and not others is what a race looks like, which is why the suite runs repeatedly.
Architectural walkthrough
This Phase is the centre of the Project. It prevents the client's 311 tickets for a floor of 300. Two of those came from a check followed by a save: two requests both saw tickets left, and both were told yes. Nine came from tickets given back after 10 minutes while buyers were still approving the payment in their banking app.
A race has no cure that works most of the time. At 10:00 on a presale morning, requests for the last ticket arrive within milliseconds of each other, and a product that is right in a test that sends them one after another is wrong in front of 500 fans. The same goes for the same request sent twice at once, which a double click produces all the time.
A hold is a promise that lasts 600 seconds, and a payment finishes whenever the bank lets it. The two clocks disagree for any buyer whose approval takes longer than the hold. The client wants a written answer for that buyer, and the answer must come out the same whether or not the tickets of the ended hold had shown as free again when the payment arrived.
Checkout and payment do not exist yet. For this Phase you document a way for tests to ask the product to hold tickets for an order reference and to report that a payment for a hold finished. These ways stay for the tests and real traffic replaces them in Phases 4 and 5.
Take orders
Produces an all-in price quote, a checkout that takes the tickets for a buyer, and orders that end together with their tickets when nobody pays. No payment is taken yet, so an order only waits for one.
Acceptance criteria
A quote request takes a ticket type and a quantity and returns a quote ID, the unit price in cents, the booking fee per ticket in cents, the quantity and the total. The unit price comes from the price tiers staff published and the sale window, for the instant the quote is made. The booking fee is 150 cents per ticket. The examples use the Harbour Lights gig, with the time set by the control from Phase 2.
- 2 Standing tickets at 21 Mar 2027, 09:30 UTC, during presale, return unit price 2200, fee 150 and total 4700. The same request at exactly 09:00:00Z, the sale opening, also returns 4700.
- The same request at 28 Mar 2027, 07:59:59 UTC returns 4700, and at 08:00:00Z returns 5300 (2 x (2500 + 150)). That is the day the clocks change, so a product that adds 7 x 24 hours to the opening instant gets this wrong.
- 1 Balcony ticket returns 3650, and 4 Balcony tickets return 14600.
- A quantity of 0, 5, -1 or 1.5 is refused with a validation message and creates no quote. 5 is refused because one order holds at most 4 tickets of one ticket type.
- A request at 21 Mar 2027, 08:59:59 UTC, before the sale opens, and one at 12 Jun 2027, 18:00 UTC, the gig's start, are each refused as not on sale. A request at 17:59:59Z the same day succeeds.
- A quote does not check how many tickets are left, so a sold-out ticket type still quotes.
- Reading a quote back after the price tier has changed still shows the amounts it was made with, 4700 in the first example.
- A quote is valid for 600 seconds from the instant it was made. The next Checkpoint enforces that.
Architectural guidance
A checkout that adds the booking fee, or looks up the price again, when the payment starts charges an amount the buyer never saw. On the day the price rises it also charges two buyers who stood in the same queue different amounts for the same ticket. The quote has to be something the buyer can point to afterwards, so a dispute is settled by what was shown.
Acceptance criteria
An order that is not paid by its deadline ends as expired, with its tickets available to other buyers again. The order stays visible in the status request with its amount. The examples use an order O1 for 2 Standing tickets, created at 09:30:00Z with a deadline of 09:40:00Z, and time set by the control from Phase 2.
- At 09:39:59Z the status of O1 is still waiting for payment. At 09:41:00Z it is expired, the tickets left are back to what they were before the checkout, and the order still shows its 4700 cents.
- The tickets come back once: the view shows 4 left, never 6, however often it is read and whatever else is going on.
- The process is killed at each moment of the expiry that you can tell apart, and restarted. Within 60 seconds of the deadline passing, O1 shows expired and its tickets show as free, and the two never disagree for longer than that.
- A payment for O1 reported as finished before the deadline (the way from Phase 3) stops the order from expiring, and the tickets stay sold.
- Abandoned checkout: with 2 tickets left, buyer A starts a checkout for 2 and leaves. Buyer B's checkout for 2 is refused as sold out. After 601 seconds, B's checkout succeeds and A's order shows expired.
Architectural guidance
A process that dies at the wrong moment can leave the tickets free while the order still says waiting for payment. An order that stays waiting for payment on tickets nobody holds sends the buyer to pay for a seat that may already belong to someone else, and the client finds out when the money arrives. The order is kept as expired and not removed because a payment can still come for it in Phase 5, and the client needs to see what that payment was for.
Architectural walkthrough
Three failures come back through a new door once buyers start checking out. The first is a price that changes after the buyer saw it. A checkout that adds the booking fee when the payment starts charges an amount the buyer never agreed to, and the client answers for it.
The second is a checkout that happens twice, from a double click or a request sent again after a timeout.
The third is an order that nobody pays for. Buyers close the tab, banks decline and processes die halfway through a checkout. An order that keeps its tickets forever sells out a gig to people who never pay, and an order that gives them back while the buyer is still paying is how the client ended up with nine refunds. The client wants both outcomes to be visible to the buyer in plain words: waiting for payment, or expired.
An expired order stays on record with its amount, because in Phase 5 a payment can still arrive for it.
Take payments
Produces a payment provider you control, the path from a started payment to a paid order or one full refund, and tests of every late, repeated and out-of-order case. Tickets do not exist yet, so the proof ends at a sale or a refund.
Acceptance criteria
You build a small payment provider of your own in your repository, started by one documented command. Its design and interface are yours. It must be able to cause the following, and a test can choose each one on request.
- It takes a payment for an order reference and an amount in cents. It can require a bank approval step that finishes after a delay chosen per payment, from 0 seconds up. Asking for the same order reference twice gives the same payment and creates no second one.
- It tells the product how a payment ended by sending a message to an address you configure. A message says which order, the amount, whether the payment succeeded or failed, when the provider says it happened, and an identity that is the same every time the same message is sent.
- It can send a message on time, late (held until a test releases it, while the time it says it happened stays the instant of the bank's approval), twice, and out of order: a failure that happened first arrives after a success that happened 3 seconds later.
- When the product does not acknowledge a message with a success status, it sends the message again up to 3 more times, 2 seconds apart, a compressed version of a real provider's resends, which run for up to 3 days.
- It takes a refund request for an order reference and an amount. A test can tell it to fail the next refund request without recording anything, and the request after that succeeds and records one refund. Asking it to refund the same order reference twice records one refund.
- A test can set how long approvals take and how messages are delivered for payments created afterwards, so a checkout that goes through the product, which sends neither, can be steered.
- It keeps a log of every request it received and every message it sent, readable by a test. It has no accounts and no cards.
Run by hand against a throwaway listener, a payment that is told to send twice shows two posts of one message in the log, and a payment told to reorder shows a failure and a later success arriving in the wrong order.
Architectural guidance
A bank approval keeps the payment waiting while the buyer opens their banking app, and the hold's 600 seconds keep running, so any approval that takes longer ends in a successful payment on tickets already given back. Real providers also repeat and reorder their messages. A rule about that behaviour can only be tested against something that misbehaves on command, and a provider built from the product's own assumptions can hide a bug both sides share.
Acceptance criteria
After an order is created, checkout starts the payment with your provider and tells the buyer whether they must approve at the bank. The amount charged is the quoted amount. The provider receives the order reference and the amount only. The examples use the 4700-cent quote.
- After a checkout, your provider's log shows one request to create a payment, which holds the order reference and 4700 cents and nothing else. A test checks it with a buyer name and email made of unique strings and finds neither in the log.
- Pressing pay twice for one order, or sending the checkout again after a lost answer, leaves one payment at the provider and one order.
- The process is killed during checkout, at each moment you can tell apart, and restarted. The buyer can start the payment again and ends with one order and one payment at the provider.
- With the provider stopped, checkout waits at most 5 seconds and then tells the buyer that payment is unavailable. The order shows payment failed and the tickets are available again.
- With the provider's default approval delay set to 5 seconds, checkout tells the buyer to approve at the bank. With the default set to 0, it says no approval is needed.
- The buyer never sees the provider's own identifiers or status words. A search of the product's responses for them finds none.
Architectural guidance
A payment started twice charges the buyer twice, and a timeout leaves the product unable to tell whether the provider created the payment. The provider needs the order reference to match a payment to an order and has no use for the buyer's name or email. Every copy of personal data that leaves the product is a copy the client cannot erase later.
Acceptance criteria
The product accepts the provider's messages at an address you document, which is what an outside provider needs to know. The order status request shows the payment's state in plain words: waiting for approval, succeeded or failed. The examples use a payment for order reference R1 and 4700 cents.
- A message is acknowledged with a success status within 2 seconds, the gap between the provider's resends. The same message sent several times is acknowledged each time and changes the payment's state once.
- The product is killed right after it acknowledges a succeeded message. After a restart, without the provider sending it again, the payment ends succeeded, once.
- A succeeded message that the provider says happened at 09:31:03Z arrives, then a failed message that happened at 09:31:00Z. The payment ends succeeded and the late failure changes nothing.
- The failed message arrives first and the succeeded message second. The payment ends succeeded.
- Two messages that say they happened at the same instant end with a payment that is succeeded, whichever arrives first, because the client treats a success as final.
- The time the product received a message never decides anything. Swapping the arrival times in the data changes no outcome.
- A message for an order reference the product has no payment for is acknowledged and changes nothing. A message without an identity or with an unknown outcome is refused.
Architectural guidance
A provider that gets a slow or failing answer sends the message again, and a message the product already acknowledged is not sent again, so it must not be lost when the process dies.
Acceptance criteria
A successful payment ends the order in one of two ways, by the client's rule from Phase 1. If the tickets are the buyer's, the order shows paid. If the payment is refused, the order shows refund pending, the full amount goes back through your provider, and the order shows refunded. The examples use capacity 4 and an order O1 for 2 tickets and 4700 cents.
- Payment on a live hold: O1 shows paid and the tickets stay sold.
- O1 expired at 09:40 and 2 tickets are still free. A payment at 09:41 changes O1 from expired to paid. No refund exists.
- O1 expired and another buyer then took 3 of the 4 tickets, leaving 1. A payment at 09:41 ends with O1 refunded. Your provider's log shows exactly 1 refund for O1 of 4700 cents, booking fee included. The tickets left do not change.
- A success message delivered twice for one order leaves one paid order, or one refund.
- The provider is told to fail the next refund. O1 shows refund pending until the refund goes through, by itself or by the operator step in the README, and then shows refunded with one refund of 4700 in the provider's log. If the process is killed during a refund, at each moment you can tell apart, O1 still ends with exactly one refund.
- A failed message for an order waiting for payment makes the tickets available again and the order shows payment failed, with no refund. A failed message for a paid or refunded order changes nothing.
- A succeeded message for an order that shows payment failed follows the same path as for an expired order and ends paid or refunded.
Architectural guidance
A late payment is the case the nine buyers hit, and the answer has to be right at the moment the payment is settled, not at the moment the buyer checked out. Repaying a buyer twice is the failure to design against, because a refund can be asked for again after a crash and the second request can reach a provider that already acted. The client must never have a successful payment that is neither a ticket nor a refund, because the only record of it is the buyer's bank statement.
Acceptance criteria
The test suite drives the running product and your provider from outside, the way a buyer, staff and a provider really would. Each scenario uses a ticket type with capacity 4 and orders of 2 tickets (4700 cents) unless stated, uses the time control from Phase 2, and ends by reading orders, the public view and your provider's refund log. The check command from Phase 3 gains a rule: every successful payment belongs to an order that is paid with its tickets sold, or refunded with exactly one refund of the full amount.
- On time: a payment 4 minutes after checkout ends paid.
- Late with tickets free: a payment 11 minutes after checkout, once the hold has run out, ends paid.
- Late with tickets gone: the same, after another buyer took 3 tickets, ends refunded with one refund of 4700.
- Repeated: delivering the success message twice ends with one paid order.
- Out of order: a failure that happened first arrives after the success. The order ends paid and the tickets are sold.
- Failed, then succeeded: the order first shows payment failed, then the success arrives. It ends paid if 2 tickets are free and refunded if not.
- Killed: the product is killed while it processes a provider message and again while it settles a payment, and restarted each time. Each scenario still ends with one outcome.
- Refund fails once: the order ends refunded with one refund.
- Race between a late payment and a new buyer: a hold of 2 has run out and 2 tickets are free. A late payment and a new buyer's checkout for 2 start from separate clients at the same moment, repeatedly. In every run exactly one of them gets the 2 tickets and the other is refused, and the tickets held and sold never exceed 4.
- The suite passes repeated runs in a row. The README records one run in which messages were applied in arrival order, where the out-of-order scenario failed, next to a run of the real product.
Architectural guidance
A payment moves the client's money, so the proof has to be about outcomes: every successful payment ends in a ticket or a refund and never in neither. The race between a late payment and a new buyer matters most, because both want the same two tickets and only one of them can have them. Breaking the ordering on purpose shows that the out-of-order scenario can fail, which is the only reason to trust it when it passes.
Architectural walkthrough
A payment provider tells the product about a payment by sending messages, and the messages have three habits. They arrive late, because a bank approval takes as long as the buyer takes. They arrive twice. They arrive in a different order than the events happened. Stripe's webhook documentation (https://docs.stripe.com/webhooks) says it does not guarantee delivery "in the order that they're generated" and that an endpoint "might occasionally receive the same event more than once".
Each habit costs the client money. A message that arrives twice can sell tickets twice or repay a buyer twice. A "failed" message that arrives after a "succeeded" message can cancel a sale the buyer already paid for. A "succeeded" message that arrives after the order expired puts the client where it was with the nine buyers: money taken for tickets that may belong to someone else.
A crash adds a fourth case. The process can die after the provider took the money and before the product wrote it down, or after it decided to refund and before it knew whether the refund went through. In both, the client finds out when a buyer phones.
You build the provider yourself so that every one of these happens on command. Tested only against a well-behaved provider, the rules are untested.
Issue tickets, cancel and prove
Produces ticket codes, admission at the door, gig cancellation with refunds, buyer erasure, and a simulated presale with a command that checks the whole product.
Acceptance criteria
When an order is paid, the product issues one ticket for each unit of its quantity. Each ticket has a code that a door scanner can read, and the buyer receives each code by email. A request for an order's tickets by order reference returns them with their codes. The mail goes to a local mail catcher or any log of outgoing mail. The examples use a paid order of 2 Standing tickets.
- The order produces exactly 2 tickets with 2 different codes and 2 emails, each with one code, addressed to the buyer's email.
- Restarting the product any number of times leaves 2 tickets, and each ticket's code is mailed once.
- The process is killed at each moment between the payment succeeding and the emails going out, and restarted. The order ends with exactly 2 tickets and each code mailed once.
- An order that ended refunded through a refused late payment has 0 tickets.
- Across many orders issued in one test, no two codes are equal.
- Changing one character of a code makes it invalid at the door. Your repository holds no secret that would let someone make a valid code, and a search of it for the secret finds nothing.
- The tickets and the codes contain no buyer name or email. A test with a name and email made of unique strings finds neither in the tickets as the product shows them or in any code.
- With the mail catcher stopped, the tickets are still issued and the order stays paid. When it is back, each ticket's code is mailed once.
Architectural guidance
A ticket exists because an order was paid, and a duplicate message or a process that restarts must not print a third ticket for a two-ticket order, nor leave a paid order with none. A code anyone can invent lets in people who did not pay, and a code with a name inside it travels in every screenshot of it. A mail server that is down must not undo a paid order.
Acceptance criteria
A door scanner sends a ticket code and the gig it is scanning for. The product answers that the ticket was admitted, or that it was refused with a reason in plain words. The README documents what the scanner sends and receives, as a guide for the people who build the door devices. You also write a command-line scanner that takes the same two values, so scans can be run twice at the same moment. Every scan attempt is recorded with its result and reason, and staff can list them. The examples use a gig with 350 issued tickets.
- A valid code for the right gig is admitted and records the admission time. The same code a second time is refused as already admitted, with the time of the first admission, and the admission time does not change. Both attempts are in the staff list.
- Two copies of the scanner send one code at the same moment. Exactly one is admitted and the other is refused as already admitted. With many copies, exactly one is admitted and the rest are refused. This holds across repeated runs.
- A code with one character changed, and a code for a ticket that does not exist, are refused as invalid codes. No ticket changes.
- A valid code sent with a different gig is refused because it is for a different gig, and the ticket is not admitted. Sent again with the right gig, it is admitted.
- A request without a code or a gig is refused and is not recorded as a scan.
- With the product stopped, the scanner exits with a non-zero status and a message that it could not reach the product. Nobody is admitted.
- The next Checkpoint adds a fourth refusal, that the order was refunded.
Architectural guidance
A photograph of a code shown on two phones makes a double scan routine at a busy door. If both scanners find the ticket not yet admitted and both let a person in, the floor holds one more person than the venue sold tickets for. Every attempt is recorded so the door staff can see who tried twice.
Acceptance criteria
A staff request carrying the shared staff secret cancels a gig. After a cancellation no new tickets can be held for the gig, every paid order is refunded in full, and every unpaid order ends. The examples use Harbour Lights with several paid orders, some orders waiting for payment and one expired order whose payment is still in flight.
- A missing or wrong secret is refused and changes nothing. An unknown gig is refused as not found. Cancelling twice succeeds the second time and changes nothing.
- After cancelling, the public listing does not show the gig, quotes for its ticket types are refused as not on sale, and a request to hold tickets is refused.
- All the paid orders end refunded. Your provider's log shows exactly one refund per paid order, each equal to its order's amount including the booking fee.
- The orders waiting for payment end expired with their tickets given back. No refund exists for them.
- A payment that finishes afterwards for one of those orders, or for the expired one, ends with the order refunded.
- Repeating the cancellation, and killing the process at several moments during it and restarting, both end with one refund per paid order and no order refunded twice.
- The provider is told to fail one refund. That order stays refund pending and all the other paid orders end refunded. After the operator step in the README, or by itself, it is refunded and the log shows one refund per paid order.
- Scanning a ticket of a refunded order is refused because the order was refunded, and the ticket is not admitted.
- The check command from Phase 3 still passes.
Architectural guidance
A cancellation that refunds orders in one loop and stops at the first error leaves some buyers repaid and some not, with no record of which. A refund that is repeated after a crash must not repay a buyer twice, since the client then recovers the second payment by phone. A payment that finishes after the cancellation must go back too, or the client keeps money for a gig that will not happen.
Acceptance criteria
A staff request carrying the shared staff secret erases the buyer's name and email for an order reference. The order, its amount, ticket type, quantity, payments, refunds and tickets stay, identified by ID. An unknown reference and a missing or wrong secret are each refused. The examples use a paid order with the buyer name "Zelda Quill" and the email zelda.quill@example.test.
- Before the gig has happened, with the time set to 12 Jun 2027, 17:59:59 UTC, the request is refused and nothing changes. At 18:00:00Z, the gig's start, it succeeds and the name and email are gone.
- An order waiting for payment or refund pending is refused whatever the time is, since money is still in flight. An order of a cancelled gig can be erased once it is refunded.
- Erasing the same order again succeeds and changes nothing.
- After erasure the product has no contact details for the order. No ticket code is mailed for it afterwards, without an error, and tickets issued for it afterwards are created without mail. Its tickets are still admitted at the door.
- Before the erasure, a search for the name and for the email through everything the product has stored, in full and wherever it keeps it, finds them only in the buyer's order. That includes anything the product kept of what the provider sent and of work that failed. The provider's request log, the product's log files and the ticket codes contain neither. After the erasure the same search finds neither anywhere.
- The README states that Dutch tax rules oblige the venue to keep its business records for 7 years, so orders, payments, refunds and tickets stay for 7 years, identified by ID, while the name and email go. It notes that the mail catcher, or any real mailbox, holds copies outside the product.
Architectural guidance
Personal data copied into a log line or anywhere else the product writes while it works is the copy that survives an erasure request. Searching everything for a real-looking name finds the copies that reading the code misses. Erasure waits until the gig has happened and the money has settled so the venue still has what it needs to refund, admit and answer a payment dispute. The 7 years are the venue's own duty under Dutch tax rules, and a request to erase more than the name and email cannot override it.
Acceptance criteria
A simulator takes a seed and plays a presale against the running product, started as the README says, with your payment provider. It moves the product's time with the control from Phase 2. The gig has Standing with capacity 300 and Balcony with capacity 50. The simulator plays:
- 800 buyers, split between Standing and Balcony, each wanting 1 to 4 tickets, who arrive within the first 60 simulated seconds with many requests in flight at once.
- 10% of the payments that start finishing after their hold ended, by moving time forward 601 seconds before your provider delivers the message.
- Some provider messages sent twice and some reordered.
- The product killed with SIGKILL in the middle of its work and then restarted, more than once.
- Door scanners: every issued ticket is scanned once, some by two scanners at the same moment, plus some invalid codes.
The check command extends the one from Phase 3 and prints one line per rule. After the run it exits 0. The rules, for each ticket type, are: the tickets left in the public view plus the tickets held and sold add up to capacity, and held and sold never exceed it. No order has a successful payment and neither tickets nor a refund. No ticket has more than one admission.
- Three different seeds each pass.
- Three deliberate breaks each make the command exit non-zero and name the failing item: a ticket type with more sold than its capacity, a paid order with a ticket missing, and a ticket admitted twice. The README says how you produced each, and undoing each returns the exit status to 0.
- The results of the three runs are committed to your repository: the seed, the counts of orders by state, the refund count and total in cents, the tickets issued, the scan results by kind, and the full output of the check. Each run shows at least one order paid on time, one paid after the hold ended, one refunded after a refused late payment, and one scan refused as already admitted.
- The Standing tickets sold in every run are at most 300 and the Balcony tickets at most 50.
- The README names the one command that runs the whole proof, and the minutes it takes.
Architectural guidance
A simulation is only evidence if it can fail, so the corruptions matter as much as the clean runs: they show that each rule notices its own breach. The run has to use real concurrency and a killed process, because the bugs this project guards against are timing bugs that a test taking one request at a time cannot reproduce. The exact counts differ between runs while "no ticket type above capacity" and "every payment ended in a ticket or a refund" hold for every ordering, so those are what the check asserts. A failure on only some seeds is the race you were looking for.
Architectural walkthrough
The failures in this Phase are the ones the client has not met yet: a ticket code read by two scanners at the same moment or invented by someone who never paid, a cancelled gig whose refunds stop halfway or repeat, and a buyer's name left behind in a copy nobody looks at.
The last Checkpoint is the proof. A simulator plays 800 buyers, late payments, repeated and reordered messages, a killed process and doubled scanners against the running product, and one command reports whether the numbers add up.
Architectural walkthrough
The last ticket
The old page checked how many tickets were left in one step and saved the booking in a second step. At 10:00 about 500 fans arrived in the first minute, and two of them were told at 10:00:04 that they had the last two standing tickets. Any product that looks first and saves afterwards sells the same ticket twice when two requests arrive close together. The sold-out gig cost 311 tickets for a floor of 300, 11 refunds by hand and a touring band that watched a full house turn people away.
Check this in your build by running your own race, and then break the product on purpose. If the race tests still pass on a version that looks first and saves afterwards, they are not racing anything.
A payment that finishes after the hold
The hold lasts 10 minutes and the buyer's bank approval takes as long as it takes. Nine buyers paid for tickets that had been sold again while they were approving. With no written rule, the answer depends on which code ran last, and the client learns it from a buyer at the door.
Check three payments for the same order: one at 4 minutes, one at 11 minutes with tickets free and one at 11 minutes with tickets gone. Each ends in tickets or a full refund, and the answer does not change with whether the tickets of the ended hold have shown as free yet.
Messages that arrive late, twice or out of order
The payment provider tells the product about a payment by sending messages. Stripe's webhook documentation (https://docs.stripe.com/webhooks) says it does not guarantee delivery "in the order that they're generated" and that an endpoint "might occasionally receive the same event more than once". A repeated "paid" message can sell tickets twice or repay a buyer twice. A "failed" message that happened first and arrived last can cancel a sale the buyer already paid for, and the client holds money for an order that says payment failed.
Check that every message your provider can send, in every order it can send them, ends in one outcome per order.
A crash between saving and what follows
A process can die after it saves a gig and before the tickets go on sale, after it takes the tickets and before it saves the order, after the provider took the money and before the product wrote it down, and after it decided to refund and before it knew whether the refund went through. Each leaves a loss the client finds out about from a buyer: a gig with no tickets, tickets nobody owns, a payment with no ticket, or a buyer repaid twice.
Check each by killing the process at that moment, restarting it and counting what exists. The count is the same as if nothing had happened.
Two scanners, one ticket
A photograph of a ticket code shown on two phones lets two people in on one ticket when two scanners read it at the same moment. The floor then holds one more person than the venue sold tickets for. A code that anyone can invent lets in people who never paid.
Cancelling a gig and erasing a buyer
A cancelled gig with many paid orders is refunded one order at a time. A request that stops at the first error leaves some buyers repaid and some not, and a retry can repay the same buyer again. An erasure request is only done when the name and email are gone from every copy, and the copies are in places nobody looks until a search for the name finds them, such as logs and anything else the product writes while it works.
Check both against the numbers: one refund per paid order and none for the rest, and a full search of everything the product keeps, its logs and the provider's records that finds no trace of the erased name.
Where it shows if you cut a corner
A race test that runs in one process passes on the broken version, and the simulated presale in the last Phase, with 800 buyers for 350 tickets, finds the oversold ticket the small tests missed. A provider you built to behave never exposes the late and reordered messages that real providers send. A refund you only tested once is repaid twice the first time the process dies mid-refund. The check command at the end names the order, the ticket type or the ticket that breaks a rule, and the committed results of three seeded runs show a reviewer that it can fail.