Build a Restaurant Group Back-Office
A restaurant group has outgrown the cloud till it runs on: when the connection dropped on a Friday, its terminals could not see each other's orders and the last portions of one dish were sold three times. You will build the group's back-office, from booking a table and firing a course to selling the last portion once, closing the business day and reporting it, and prove it survives a simulated Friday with failures injected.
The brief
The client
I own three restaurants of 60 seats each in the Netherlands, with one shared menu and one head chef who writes the recipes for all three, and we serve about 240 covers a day at each site. On a Friday evening the cloud service behind our tills went down for about an hour and a half. The tills kept taking orders in offline mode, but each terminal held only its own orders, so the kitchen display at the grill never saw what the second terminal took. The last lamb shoulders were sold on two terminals and on the delivery app, and three tables waited on one dish.
When the connection came back, a guest who had ordered through the app turned out to have been charged for an order that never reached a till. I found out because he phoned. I need one system where the tills keep working without the cloud, where the last portion is sold once, and where yesterday's numbers are right the next morning.
The problem
Today the group runs a cloud till for orders and payments, a booking widget, a rota spreadsheet and a stock spreadsheet, and the bookkeeper is the integration. A dish runs out mid-service because stock is counted by hand on Sunday night, and nobody learns it until a guest is told. The till subtracts from a portion count when an order is entered, so when two terminals and the delivery app read the same number at the same moment, the last portion sells more than once. When the cloud is gone the terminals cannot see each other, and on reconnect nobody can say which orders are duplicates.
The day is whatever the till closed at 04:00, so an order rung at 01:30 on Saturday belongs to Friday's takings, but the rota spreadsheet and the bookkeeper use the calendar date and disagree with it. Money moves in six directions: guests pay, tips go to staff, wages go out, suppliers are paid against invoices that arrive after the delivery, delivery platforms keep a commission, and the card processor settles a batch later. Each leaves a figure that has to match the others at close.
The owner reads one figure above all, prime cost (food plus labour as a share of sales), and it stays a guess until the next hand count, because food cost depends on that count. A manager approves voids and comps at the till and nothing records who. An inspector can ask for the fridge readings and for which supplier lot went into which dish, and today the answer is a binder.
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 guest book a table for a party size and time, hold it for the length of a turn, cancel it, and offer a cancelled table to the waitlist; mark a no-show, release the table and charge the card-guarantee fee exactly once.
- Let servers place orders with courses and allergy flags, show each kitchen station only its own items on a display, and let cooks bump and recall tickets.
- Sell each limited dish no more times than there are portions, across every terminal and the delivery platform at once, and take the dish off sale everywhere within 10 seconds of its last portion selling.
- Split a check across cards and cash, take the tip the guest chooses on the card terminal as part of the card payment, refund a line with a named manager, and settle a check only when its parts add up to its total.
- Record deliveries by lot against purchase orders, match supplier invoices to both, count stock, say which dishes used a recalled lot, and keep the fridge logs an inspector can ask for.
- Publish rosters that respect rest rules, handle swaps, and share pooled tips by minutes worked with retained records.
- Keep terminals taking orders and card payments through an outage of their connection to the cloud, and merge their backlog on reconnect without losing or duplicating an order or a payment.
- Accept orders from delivery platforms, reject those for dishes no longer available, and reconcile what the platform pays against what was sold.
- Close each site's business day, produce the Z report (the end-of-day sales summary), and give the owner yesterday's sales, covers, labour percent, food cost and usage variance.
- Keep serving through a stopped or updated capability: with card payments stopped, tables are still booked and orders taken; with stock stopped, terminals keep selling the portions they can confirm; with booking stopped, seated parties still order; a change shipped during service drops no order.
Deliverables
- Your repository starts the whole product with one command, plus a simulator that plays the guests, hosts, servers, cooks, managers, suppliers, card processor and delivery platform, with seed data for 3 sites, 60 dishes, 120 ingredients, 12 suppliers and 8 limited dishes.
- A README that takes a reviewer from a fresh clone to a closed day with a Z report in 20 minutes, and lists the command that runs each test the brief asks for.
- A way to run the group's day faster than real time and to cause each outside failure the brief names: terminals cut off from the cloud, any one named capability stopped and started again, the processor answering late or not at all after it has taken the money, the delivery platform sending an order twice, losing one or answering late, a supplier invoice arriving before its delivery, and the product killed in the middle of a save.
- A description of the purchase order document a supplier receives and of the 90-day export an inspector receives, so each knows what to expect.
- A test suite covering every failure test in the brief, plus the results of the simulated Friday from the final Phase, committed to your repository.
- An operations note stating what an operator must be able to do: follow one guest's visit from booking to payment, retry a record that keeps failing, erase a person's details on request, produce the inspector export, and restore the reports from stored data.
Out of scope
- Payroll calculation. Staff scheduling outputs hours and tip shares; computing pay needs rules that differ by country.
- Accounting export. Reports end at the daily summary; an accounting integration adds no new problem.
- Fiscalisation, meaning signed receipts and a tax-inspection export. The rules differ by country and change, so the brief picks none.
- Tax lines. Prices and totals are gross amounts in cents; tax rates differ by country and order type, and any rate here would be invented.
- Real card processing. The processor is a simulator you write, with the behaviours the brief names.
- Supplier electronic ordering. A purchase order leaves as a document a person could send.
- Credit notes for short deliveries and premium pay for late roster changes. A short delivery holds its invoice and resolving it is outside the brief; roster changes carry no premium pay.
- A guest-facing booking site, ordering on the group's own website, or a staff mobile app. The simulator plays the people, and a terminal or a display is checked by what it accepts and shows, not by how it looks.
- Demand forecasting and automatic roster generation. Optimal scheduling is a research field of its own; the brief checks a roster a person built.
- Stock transfers between sites and a central kitchen. Each site holds its own stock.
- Sharing no-show history between sites. Guest data is kept per site.
- A purge of checks, payments, shifts, fridge logs or lot records. They stay after a person's details are erased. The client is a Dutch business and must keep its business records for 7 years (Belastingdienst rule), so no deletion period is built or tested.
- Kubernetes or cloud deployment. Everything runs on one machine.
Architectural constraints
- Amounts are exact to the cent, weights are whole grams and temperatures are whole tenths of a degree Celsius, negative below zero. Prices and totals are gross: there is no tax line.
- No full card number is ever stored. The group keeps the last four digits and whatever the processor hands back to charge the card again.
- Money is taken only against a check the server has closed.
- A limited dish is never sold more times than it has portions. The group would rather turn a guest away than sell a portion twice.
- Corrections never erase. A void, a comp, a refund, a stock count, a tip correction and a drawer count each leave the earlier figure readable and name the person who approved it. The approver's name and role are taken from the terminal login and are not verified.
- Every moment is recorded so that the order of events survives clock changes. Reports group by business day, which ends at a per-site cutoff (04:00 by default), and never by calendar date.
- A capability that is stopped may slow the others and never makes them fail. The one stated exception is a limited dish whose portions a terminal cannot confirm while stock is unreachable: it shows as sold out at that terminal.
- Guest names, phone numbers and allergy declarations are erased 12 months after the guest's last booking and on request. Staff names and contact details are erased 12 months after the person's last shift and on request. Checks, payments, shifts, fridge logs and lot records stay, identified by ID.
Prerequisites
You have finished an intermediate project or have equivalent experience: you have built applications that keep data in a database and talk to an outside system. Any language and framework will do. You do not need to know how a restaurant group runs its service; the first Phase explains the business and the words the brief uses.
Free to start. An account is what keeps track of the checkpoints you finish.
Map the service day and start the clock
Produces a written map of one service day, a rule that files every sale on the right business day, and one command that starts the product and a simulator with a clock you control. It adds no restaurant behaviour yet, which starts in Phase 2.
Acceptance criteria
A document in your repository maps one service day at one site in the restaurant's own words. It covers prep before lunch (12:00 to 15:00), dinner (18:00 to 23:00) and the rollover at 04:00, with the group's volumes: about 90 lunch and 150 dinner covers a site, about 36 online orders a site, and about 720 covers across the three sites.
It lists every person and partner who touches a visit: guest, host, server, cook, manager, supplier, card processor and delivery platform. For each it says what they decide, what they see, and whether your simulator plays them. A glossary defines cover, course, fire, bump, recall, void, comp, 86, turn, lot, Z report and drawer in a sentence each, in words a new server would follow.
The document lists at least eight things that go wrong in a service, including a no-show, a dish that runs out, a void after the dish is started, a recalled lot, a short delivery, a till that loses its connection, an order rung after midnight, a card taken with no answer and an online order sent twice. Each names who notices first and what they do today. Someone who has never worked in a restaurant can follow one guest from booking to payment using only the document, and the document names no software part.
Architectural guidance
Every later Phase is built against this picture of the day. A wrong picture shows up late: a rule about when stock goes down or who may approve a void gets built, and then the person who does that job contradicts it. The list of things that go wrong is where the failure tests in the rest of the brief come from.
Acceptance criteria
Given a site and a moment, the product states the business day, and every sale, shift and fact it records carries that day. The day is the site's local calendar date of the moment minus the site's cutoff, which is 04:00 unless the site says otherwise. A person can ask for the day for a site and a moment through a command or a screen.
A list of cases that a test runs covers a site in Europe/Amsterdam. A check opened at 01:30 on Saturday belongs to Friday. 03:59:59.999 belongs to the previous day and 04:00:00.000 to the day itself. The two clock-change nights of 2026, into 29 Mar 2026 and into 25 Oct 2026, make the business days that contain them 23 and 25 hours long, and every moment in them lands on the right day. A site whose cutoff is changed to 05:00 files later facts under the new cutoff while facts already recorded keep their day. A shift that crosses the cutoff belongs to the day it clocked in.
A fact that happened at 01:30 and reached the product at 09:00 is filed under Friday. What a person sees in order follows when things happened, not when the product heard about them. Reports group by business day and never by calendar date. Run the cases once against a build that subtracts a fixed number of hours from the moment and record which cases fail; the two clock-change cases must be among them.
Architectural guidance
A rule that works on 363 days of the year and fails on the two nights the clocks change files sales under the wrong day when nobody is checking. A sale that arrives hours late has to land on the day it happened, or the day the bookkeeper closes will not match the day the rota paid for.
Acceptance criteria
One command from a fresh clone starts the product and the simulator. Running it again on a running product changes nothing and starts nothing twice. The simulator plays from a seed: the same seed plays the same day and a different seed plays a different one.
The simulator controls the clock the product reads. In simulation mode a jump of six hours moves every time the product reports by six hours. Outside simulation mode the product uses real time, ignores a jump request and says that it did.
The README lists the command that runs each test the brief asks for so far, which are the business-day cases and a startup check that runs the one command on a clean clone and sees the product answer. Each passes. The README says that later Phases add a way to stop and start each capability and to cause each outside failure, and you add those as the Phases ask. A reviewer following the README from a fresh clone reaches a running product and a passing business-day check in a few minutes; by the last Phase the same README reaches a closed day with a Z report in 20 minutes.
Architectural guidance
Every time rule in this brief is a deadline: 20 minutes to a no-show, 90 minutes of outage, 12 months to an erasure. If time cannot be moved, each one takes a real day to prove or goes untested. A reviewer who cannot start the product from a fresh clone gives up before reaching any of them.
Architectural walkthrough
How a restaurant group runs a service day
The group has three restaurants of 60 seats in the Netherlands, with one shared menu and one head chef who writes the recipes for all three. Each site serves about 240 covers a day. A guest books a table through a booking widget or arrives without one. Servers take orders on tills, a kitchen display shows each station only its own items, and guests also order through delivery platforms.
A normal evening has bookings held for the length of a turn, a waitlist for cancelled tables, and a few limited dishes that run out. The kitchen cooks from deliveries that arrive against purchase orders, and the supplier's invoice follows later. Managers approve voids and comps at the till. At close, each site counts its drawer and the card processor settles its batch afterwards, and the delivery platforms pay what they owe minus their commission.
Behind the service sit the rota, the tip pool and the stock count. Staff are rostered with rest rules, and pooled tips are shared by minutes worked. The owner reads prime cost every morning, and an inspector can ask for the fridge readings and for which supplier lot went into which dish.
The words this brief uses:
Cover: one guest served. A site serving 240 covers a day served 240 guests.
Turn: the length of time a table is held for one party before it is offered to the next.
Ticket and bump: a ticket is one order's items for a station. A cook bumps it to mark it done, and can recall it.
Limited dish: a dish with a fixed number of portions for the day, such as the last lamb shoulders.
Void and comp: a void removes a line from a check, and a comp gives it free. A manager approves both.
Business day: the trading day, which ends at a per-site cutoff, 04:00 by default, and not at midnight.
Z report: the end-of-day sales summary for one site.
Prime cost: food plus labour as a share of sales.
Lot: one delivery of an ingredient from a supplier, identified so that a recall can name the dishes that used it.
Purchase order: the document the group sends a supplier to order goods. The supplier's invoice is matched to it and to the delivery.
Why the day is not the calendar date
The group's day does not end at midnight. An order rung at 01:30 on Saturday belongs to Friday, because the kitchen is still closing Friday dinner. A report that groups by calendar date splits that dinner across two days, and the owner reads a quiet Friday and a busy Saturday that never happened. The bookkeeper and the rota use calendar dates, so the three disagree about what a day earned.
Two nights a year the clocks change and the business day is 23 or 25 hours long. A rule that subtracts a fixed number of hours files sales under the wrong day on exactly those nights, when nobody is checking. A terminal that sends a sale hours after it happened must still file it under the day it happened, not the day the group heard about it.
The group has a second problem before any code: nobody has written down how a day runs. Everyone who touches a visit, from the host to the delivery platform, sees a different slice of it, and each notices a different failure first. Without a map in the restaurant's own words, the later Phases are built against a guess, and the first busy Friday shows which part of the guess was wrong.
The last problem is testing. Rules measured in minutes and hours, such as a no-show after 20 minutes or a 90-minute outage, cannot wait for real time. If the day cannot be sped up and the outside failures cannot be caused on demand, none of the rules in this brief can be shown to hold. A product a reviewer cannot start from a fresh clone costs the same patience.
Book and seat tables
Produces bookings that hold a table for a turn, a waitlist, a release for parties that never arrive, an overbooking rule for peak slots, and a test with two hosts racing. It leaves the no-show card fee for Phase 8.
Acceptance criteria
A host books a party for a size, a start and a site. The table or tables held cover the party for a turn: 90 minutes for a party of 2 or fewer, 120 minutes for 3 to 5, 150 minutes for 6 or more. Tables can be joined for one party, and the site's tables together seat 60. A party of 4 booked at 19:00 holds to 21:00: a booking for 21:00 at that table is accepted and one for 20:59 is refused with nothing stored. Times are shown in the site's time zone.
A host can seat a reserved party. A walk-in is seated at a table that is free for a full turn from now, and refused when none is. The party's declared allergen codes, from the 14, go with the seating, and an unknown code is refused. A guest's name, phone number and allergy declaration are kept for the booking and appear on the booking only, and no check, ticket or report shows them. A booking for an unknown site is refused with nothing stored.
The product is killed after a booking is saved and before the host sees the answer, then restarted: the booking is there once. With booking stopped, nobody can book, and every booking already saved is back when booking starts again.
Architectural guidance
A guest's phone number copied onto every check and ticket is a record the group must find and erase later. A booking saved and lost in a crash is a guest who arrives to no table.
Acceptance criteria
A guest or a host can cancel a booking that has not been seated. Who cancelled is recorded and the table is released at once. Cancelling a booking that carries a card guarantee charges nothing. Cancelling twice is one cancellation. Cancelling an unknown or a seated booking is refused.
A party can join the waitlist with a size and a desired time. A freed table is offered to the first waiting entry, in order of joining, whose party fits and whose desired time is not earlier than the freed hold. The offer is open for 10 minutes and holds the table for that entry only. Accepting turns it into a booking. Declining, or letting it lapse, passes the table to the next fitting entry. With the simulator clock moved past 10 minutes the offer lapses with nobody acting. A freed table never has two open offers, even when two cancellations free two tables in the same second.
Architectural guidance
A table released and never offered stays empty while a waiting party leaves. An offer that stays open forever blocks the next party, and two offers for one table put two parties in front of the same host. The cost is revenue lost on the busiest evenings and an argument at the door.
Acceptance criteria
A booking that is not seated 20 minutes after its start is marked a no-show. With the clock at 19 minutes 59 seconds past the start nothing is marked, and at 20 minutes it is marked. The table is released and the booking shows that a no-show fee may follow (Phase 8 charges it). A seated or cancelled booking is never marked. Marking twice marks once. A guest who arrives after the mark is seated as a walk-in and the mark stands.
Ending a seating releases its table, and moving a seated party to another table releases the first one. Every release offers the table to the waitlist as in the previous Checkpoint.
Architectural guidance
A table held for a party that is not coming is a table the room cannot use, and about one booking in ten is that party. A release that depends on a host remembering leaves the table empty while a waiting party walks out. A no-show mark on a booking that was seated costs the group a guest and a fee it must refund.
Acceptance criteria
You define the peak slots and write down which they are and why. Outside a peak slot bookings stop at 60 seats. Inside one they stop at 66, which is 10% over, and a booking that would pass 66 is refused with nothing stored. A booking beyond 60 has no table assigned yet.
When everyone shows, parties are seated in arrival order, meaning the order in which a host seats them or asks to, and not in booking order. The party that arrives last waits at the front of the waitlist, ahead of every other entry including walk-ins, keeps its booking, and is offered the first table released. The simulator plays a slot with 66 booked seats and nobody missing: every party is seated, late arrivals are served in arrival order, and no table holds two parties at once. It plays the same slot with its 10% no-show rate, and nobody is displaced.
Architectural guidance
The cost of getting the rule wrong is a party sent away after being promised a table, or a walk-in who jumps ahead of someone who booked.
Acceptance criteria
One documented command races at least two hosts making many concurrent bookings, walk-in seatings, waitlist acceptances and cancellations for the same tables and times. It prints the number of requests, how many were accepted, how many were refused, and 0 overlaps. For any set of overlapping requests on one table, exactly one succeeds. A check written independently of the product reads the result and finds no two active holds on one table that overlap.
Two hosts accepting the same waitlist offer seat one party. A walk-in and a booking for the same table end with one holder. The test kills the product after a booking was saved and before the host saw the answer, and after the restart the booking is there once. With booking stopped, the menu is still readable and the saved bookings return when booking starts again.
Run the test once against a build where two hosts asking in the same instant are both told yes, and record the number of overlaps it reports.
Architectural guidance
Two hosts at the busiest minute each see the same table free and each promise it, and two parties stand at one table at 21:00. A test with one host never shows this, and neither does a test that only counts bookings at the end. The check has to be written apart from the product, or it repeats the product's own mistake.
Architectural walkthrough
A table held all evening halves the room. A table held too short seats two parties at one table. The group's turns are 90 minutes for a party of 2 or fewer, 120 for 3 to 5 and 150 for 6 or more, so a party of 4 booked at 19:00 holds its table until 21:00 and the next party sits at 21:00.
Two hosts working at once each see the same free table and each promise it. Two parties then stand at one table at 21:00 and a host explains it to both. It happens at the busiest minute of the evening and never shows in a quiet test with one person.
About one booking in ten never arrives. A restaurant that never overbooks leaves seats empty at its busiest hour. One that overbooks with no rule has no answer on the evening when everyone shows up. The group allows up to 10% over a peak slot's capacity and wants the rule for who is seated first and who waits decided in advance.
A product that dies after saving a booking and before showing it must neither lose that booking nor make it twice. With booking stopped, nobody can book, and the group accepts that for a table. It does not accept losing bookings already made.
Take orders and run the kitchen
Produces orders with courses and allergy flags at the price and recipe sold, courses fired by rule or by hand, a ticket per kitchen station, and bump and recall. It leaves voids, closing and the visit test for Phase 5.
Acceptance criteria
A terminal, played by the simulator and registered to a site, logs a member of staff in with a staff identifier and a role.
Placing an order for a seated party keeps its lines: dish, quantity, course, kitchen station, note, allergen flag, and the price and recipe version in force at that moment. A price change after the order leaves the placed line as it was, and a new order uses the new price. A price changed at 17:55 is the price at 18:00, including when the product restarted in between. A withdrawn dish, or one taken off sale at that site, is refused, and an 86 at S01 does not stop S02. An unknown seating is refused. The same order sent twice makes one order. A seating has one order, and a second order for it from another terminal is refused. A second round adds new lines as a new course numbered after the highest.
A line is flagged when the dish's allergens at the version sold include a code the party declared. A party that declared peanuts and orders a dish with peanuts is flagged, a dish without peanuts is not, and a party that declared nothing has no flags. The order never shows the guest's name or phone. An order placed at 01:30 on Saturday carries Friday's business day. With booking and menu publishing stopped, servers keep taking orders for parties already seated, at the last published prices and versions.
Architectural guidance
An order that reads the menu as it is now changes what a guest bought after the fact, and a check printed at lunch prices ends at dinner prices. An allergen flag taken from today's dish instead of the dish as sold reaches the kitchen wrong or not at all. A server cannot stop taking orders because someone is editing the menu.
Acceptance criteria
Courses are numbered from 1. An order is placed in manual mode or in rule mode. In manual mode a server fires each course by hand. In rule mode course 1 fires when the order is placed, and a later course fires when every ticket of the course before it has been bumped (the next Checkpoint finishes that half). Firing a course sends its lines to the kitchen. Firing the same course twice, from a double tap or a retry, fires it once. Firing a course with no lines is refused. A fired course keeps the recipe version sold.
A second-round course is not fired when it is added. In manual mode a server fires it. In rule mode it fires at once if every earlier course's tickets are already bumped, and otherwise after the earlier course is bumped.
Architectural guidance
A double tap on a tablet is routine on a busy Friday. If it fires a course twice, the grill cooks two plates and one is thrown away, and the guests' next course arrives before they have finished the last. A course that fires too early or not at all leaves a table waiting or a plate going cold.
Acceptance criteria
Firing a course makes one ticket for each kitchen station that has lines in it. Three grill lines and two cold lines make two tickets, each holding only its own station's items. The kitchen display for a station lists its open tickets oldest first, by the time the course was fired, and shows each item's allergen flag and note. It never shows the guest's name. Firing the same course twice makes no second ticket. A second-round course reaches the kitchen only when it is fired, not when its lines are added.
Architectural guidance
A cook who sees every station's work on one screen cooks the wrong dish or loses the one that matters in the noise. A ticket missing its allergen flag or its note sends the wrong plate to a table. A ticket made twice cooks the plate twice.
Acceptance criteria
A cook bumps a ticket when it is done, and the product keeps its prep time in seconds, from appearing on the display to being bumped. Bumping twice, from a second display or a retry, counts once. Prep-time figures per station and per dish count each ticket once.
A recall reopens the ticket on the display. It never un-fires a course, and a bump after a recall is a new bump. In rule mode the next course fires when every ticket of the earlier course is bumped. With course 1 on grill and cold, bumping only the grill fires nothing, bumping the cold ticket fires course 2, and a recall and a second bump of course 1 does not fire course 2 again. The kitchen and the order may disagree: a recalled ticket is open on the display while the order shows the course as fired.
Architectural guidance
A cook who recalls a ticket to fix a plate must not cause the next course to fire a second time. If it does, the table gets two entrees and nobody can tell which is real. A bump counted twice makes prep times look better than they are and hides the slow station.
Acceptance criteria
A named test, with its command in the README, sends the same order twice from a terminal and finds one order, and a second order for the same seating from another terminal is refused. A price changed at 17:55 is the price at 18:00 for a new order, also when the product restarted in between, and a placed line keeps the price it was sold at. Three grill lines and two cold lines make two tickets when the course is fired, firing it twice makes no third ticket, and a station display never shows a line of another station or the guest's name. Bumping twice counts once, and recalling and bumping course 1 again does not fire course 2 a second time. A party that declared peanuts and orders a dish with peanuts is flagged, and a party that declared nothing has no flags.
Architectural guidance
An order sent twice cooks and charges the same meal twice. A ticket on the wrong station is cooked late or not at all, and a missed allergy flag puts a guest at risk.
Architectural walkthrough
The order is the spine of a visit. The guest bought a dish at a price, and nothing the group does afterwards may change what was bought. A price changed at 17:55 is the price at 18:00. A recipe revised at 19:00 changes nothing about the plates sold at 18:30. An order that follows the menu as it is today rewrites a check the guest has already seen.
The kitchen has its own view of the same visit. A ticket on the grill display has a life of its own: a cook bumps it, recalls it, or sees it on a second display. The order and the kitchen may disagree for a while, and that is fine. A recall that sends the next course a second time puts two entrees in front of a table that wanted one.
A guest who declared an allergy orders, and the flag has to reach the cook. If it does not, the wrong plate leaves the kitchen and the group learns about it from the table. Servers also keep taking orders when booking and menu editing are stopped, and a double tap on a tablet is routine on a Friday that must not place an order twice or fire a course twice.
Correct and close a check
Produces voids and comps that name the manager who approved them, a closed check with the right total, and a visit test that kills the product at random moments. It leaves taking money for Phase 8.
Acceptance criteria
A void or a comp needs a manager's staff identifier and role, as asserted at the terminal login and recorded as given; nothing verifies them. A non-manager is refused and nothing is stored. A void keeps the line in the history and records whether the line's course had already been fired. A comp offsets an amount without editing the line and cannot exceed what is left of the line after earlier comps. A reason is required.
Voiding the same line twice, from a double tap or a retry, is one void. On an open ticket the voided line is marked so the cook does not make it. The history of every void and comp stays readable in order, each with its approver. After the check is closed, a void or comp is refused.
Architectural guidance
A void that edits the line away leaves the owner a gap and no way to ask who approved it. A void that does not reach the open ticket means the cook makes a dish the guest no longer pays for. Whether the course had already been fired decides if the plate is waste, and it cannot be recovered later if it was not recorded at the time.
Acceptance criteria
Closing a check gives the total after voids and comps, and the amount of each line. Lines of 1,800, 2,400 and 950 cents total 5,150 cents. With the second line voided and 500 cents comped from the first, the total is 2,250 cents and the lines read 1,300, 0 and 950. Covers equal the party size, counted once per seating, so a second round does not count the party again.
After closing, the lines are frozen: a void or comp is refused, and a later refund is a payment matter. A check whose lines are all voided closes at 0 cents. Prices are gross, with no tax line. Who closed the check is recorded. Closing twice is one close. Money is taken only against a closed check (Phase 8).
Architectural guidance
A check that can change after the guest has read it ends in an argument at the table. A total that is a cent out becomes a till that never matches its report once it is repeated across 720 covers a day. Covers counted twice for a second round make the group look busier than it was.
Acceptance criteria
One documented command prints the number of visits, the number of checks, and 0 differences. The simulator plays seeded visits: a party is seated, an order is placed in rule mode with three courses across two stations, a ticket is bumped twice, another is recalled and bumped again, a fired line is voided, an unfired line is voided, a comp is given, and the check is closed. Every action is sent twice. Each visit is compared with a reference worked out by hand from the script.
Course 2 fires exactly once whatever the recall did. A second-round course added after every earlier ticket is bumped fires at once, once. No open ticket holds a line the check shows as voided. The closed total equals the sum of the line amounts after voids and comps. The history of voids, comps and recalls only grows. A price change after the order leaves the sold lines as they were.
The test also kills the product at random moments during the scripted visits and restarts it. No placed order, fired course or ticket is lost, and none is doubled. Run the test once against a build where a void edits the line in place and record the output with its number of differences.
Architectural guidance
The cases that hurt arrive together: a double tap while a recall is in flight, a process killed halfway through firing a course. Each looks fine alone. A kitchen that cooks a course twice, or a check that shows a line the cook never made, costs the group food and the guest's patience, and nobody finds out until the end of the night.
Architectural walkthrough
A manager approves voids and comps at the till today and nothing records who. When the owner later finds a gap, nobody can say which line, which manager or why. A correction that edits the line instead of sitting beside it hides what happened. The cost is shrinkage with no name against it and a manager nobody can question.
A check is read by a guest at the table. A void, or a recall on the kitchen side, must not change a check that has already been printed. A server printing the check while a recall changes it underneath hands the guest a total that is wrong by the time they read it.
A line voided after its course was fired is waste, because the plate was cooked. Counted as nothing, it hides food cost. Counted twice, it makes the stock figure wrong.
A process killed in the middle of service must not lose an order or a course, and must not make either twice. This Phase ends with the first test that kills the product on purpose during a scripted dinner.
Sell the last portion once
Produces ingredient stock that follows the cooking, waste, limited dishes sold from portions given to each seller, and a sold-out dish that comes off sale everywhere within 10 seconds. It leaves deliveries and counts for Phase 7.
Acceptance criteria
A document classifies every dish as counted in portions (the 8 limited dishes) or counted only through its ingredient grams (the other 52, sold without a stock check and taken off sale by hand). It states the rule for each kind: for grams, corrections leave the earlier figure readable and the figure may go below zero until a count; for portions, a portion is a promise and an accepted order must be cookable.
It states when stock in grams goes down, which is when a course is fired and not when the order is placed or the ticket is bumped, and compares the three possible moments for a line voided before firing, a line voided after firing and a course never fired. It says who sets the day's portions for a dish, a site and a day (the chef, recorded) and that gram stock never takes a dish off sale by itself.
It works the example of 12 portions of the lamb special shared 4, 4 and 4 between terminal A, terminal B and the delivery platform, with a sale on each, a void before firing and a void after firing, and shows the portions available and the grams after each step.
Architectural guidance
Two numbers that look alike behave differently, and a rule worked out only after the code exists tends to follow the code. A group that cannot say when stock goes down gets a food cost that moves depending on when a ticket was bumped. The worked example is where disagreement with the chef shows up in writing, before a guest is turned away over it.
Acceptance criteria
Each ingredient has a stock figure per site, and every change leaves the earlier figure readable. The seed gives each of the 120 ingredients an opening figure at each site. Firing a course takes, for every line, the grams of each ingredient in the recipe version sold times the quantity: two portions of a three-ingredient dish take three amounts, doubled. Firing the same course twice takes nothing more. A recipe revised after the order and before the firing still takes the grams of the version sold. A second-round course takes stock when its own course is fired.
Selling a dish that is not limited when stock is already at zero is allowed, and the figure goes below zero.
Architectural guidance
Stock that falls when an order is placed is wrong for every order that never gets cooked. Stock that falls twice for one fired course makes the kitchen look short of food it has. A figure that uses today's recipe instead of the one sold makes the usage report disagree with what was on the plates.
Acceptance criteria
A line voided after its course was fired is recorded as waste for each ingredient of the recipe version sold, with the grams, the reason (voided after firing), the line and the approver. It does not take the grams from stock a second time, because firing already did. A line voided before firing records no waste.
Spoilage is logged with an ingredient, the grams, a reason (spoilage or other) and an approver, and it does take the grams out of stock. The same void arriving twice records one waste entry for each ingredient. The stock figure after a voided fired line equals what it would have been had the line been sold.
Architectural guidance
A plate that was cooked and voided is food the group paid for and cannot sell. If it is counted as nothing, food cost looks better than it is. If it is subtracted a second time, the stock figure reads short and the next count blames the kitchen.
Acceptance criteria
The chef sets the day's portions for a limited dish at a site, and the setting is recorded. Setting it below what sellers already hold is refused. A seller asks for portions and gets the smaller of what it asked for and what is left: with 12 portions, three requests of 4 each get 4 and a fourth request gets nothing. Portions given never exceed portions that exist, even when the same request is repeated after a timeout.
A terminal sells a limited dish only from portions it was given, only within 30 minutes of being given them, one portion per unit of quantity. Selling works with stock stopped. A seller with none left, or past 30 minutes, asks again. With stock unreachable a seller that holds portions keeps selling, and one that holds none shows the dish as sold out at that seller.
A seller reports what it sold when its share lapses or it hands the rest back, and only then do unsold portions return to the available count. A seller that never reports stays counted as having sold everything it was given. A void before firing returns the portion, and a void after firing returns none.
Architectural guidance
A terminal that must ask stock for every sale stops selling when the connection drops, and one that guesses sells the last portion twice. A terminal that dies holding portions and is never heard from again must not give those portions to someone else while it might still sell them. The cost of getting this wrong is a guest turned away unnecessarily, or three tables waiting on one dish.
Acceptance criteria
A limited dish is sold out when no portions are left to give and every seller's share is spent as far as stock can tell. It is then refused at every terminal, and on the delivery platform, within 10 seconds of the sale that took the last portion. When portions come back, when a seller hands unsold portions back, a line is voided before firing or the chef adds portions, it can be sold again.
However late or often a terminal or the platform hears about a change, it ends showing the latest state: hearing that the dish is back on sale before hearing the older news that it sold out leaves the dish on sale, and hearing the same change twice changes nothing. The chef's 86 is separate. A dish the chef took off sale stays off when portions return, until the chef restores it, and a sold-out dish stays off sale after the chef restores it, until portions return. A terminal holding portions keeps selling until it hears about the 86.
Architectural guidance
A dish that is sold out on one terminal and still on sale on the platform sends a guest an order the kitchen cannot cook. A change heard late or twice can put a dish back on sale when it is gone, or take it off when it is back. The chef's decision and the sold-out dish must not overwrite each other, or restoring one quietly restores the other.
Acceptance criteria
One documented command prints the number of sale attempts, the portions sold and 0 oversold. At least three terminals race on enough requests of 1 and 2 portions to reach the end many times over, with the 12-portion dish shared 4, 4 and 4. The portions sold total exactly 12, every later attempt is refused as sold out, no seller sells more than it was given, and portions given never exceed 12. The dish is off sale everywhere within 10 seconds of the 12th portion, and the test prints the measured time.
Two terminals racing for the last 4 portions: one gets 4 and the other gets none. Stopping stock in the middle of the run leaves sellers with portions selling and shows the dish as sold out at those without, and starting stock again oversells nothing. With the clock moved 30 minutes after a share was given, a terminal that sold 3 of its 4 reports and the 1 returns, and a seller that never reports stays counted as having sold all of it.
Run the test once against a build that lets two terminals sell the same portion, and record how many portions it oversells.
Architectural guidance
A race for the last portion is the failure the group lived through, and a test with one terminal at a time cannot show it. Stopping stock while sellers are mid-sale shows whether the promise to keep selling holds and whether it quietly oversells once stock returns. Without a measured time, 10 seconds is a number nobody has checked.
Architectural walkthrough
The group keeps two kinds of stock, and they fail differently. Flour is counted in grams and may read below zero until someone counts, because nobody stops selling bread over a figure. Eight dishes are limited, with a fixed number of portions a day, for example 12 lamb shoulders. A portion is a promise to a guest, and an order the group accepts has to be cookable.
The last portion is the dangerous one. Two terminals and the delivery platform each have a guest in front of them and one portion left. If each reads the same count and sells, the lamb is sold twice. On the group's last bad Friday, three tables waited on one dish, and the server found out when the kitchen said so.
Making every sale ask stock first has its own cost. A terminal that cannot reach stock either stops selling or guesses. The group chose its trade: turn a guest away before selling a dish twice, and let each seller keep selling the portions it was given earlier while cut off, for at most 30 minutes.
A terminal that dies holding portions must not let them be sold a second time. A dish that sells out must come off sale on every terminal and on the platform within 10 seconds, or the next guest orders it. A dish voided after the kitchen cooked it is gone, and stock has to say so.
Receive deliveries and match invoices
Produces purchase orders as documents, deliveries recorded by lot, invoice matching with a price tolerance, stock counts, and food costed at the price actually paid. It leaves recall tracing and fridge logs for Phase 13.
Acceptance criteria
Twelve seeded suppliers each sell a set of the 120 ingredients at a price in whole cents per kilogram. A purchase order for one site and one supplier has lines of an ingredient and whole grams. A line is worth its grams times the price per kilogram, divided by 1,000, rounded to the nearest cent with halves up. An ingredient the supplier does not sell, or a line of zero or fractional grams, is refused with nothing stored.
The order is a document a person could send to the supplier: order number, supplier, lines in grams with the price, and the total in cents. Fetched twice, it is identical. An issued order is never edited, and a replacement is a new order.
Architectural guidance
An order that is not a stable document cannot be compared with a delivery or an invoice later, because nobody can say what was ordered. Rounding that differs between lines and totals produces a bill that is a few cents out on every order. An order edited after it was sent leaves the supplier and the group disagreeing about what was agreed.
Acceptance criteria
Recording a delivery against an order creates a lot for each received line, with the supplier's own lot code, the grams received and the price. Stock rises by what arrived: 18,000 grams against an order of 20,000 raises stock by 18,000 and shows 20,000 as ordered. More than ordered is recorded as arrived. A delivery for an unknown order, or for an ingredient not on the order, is refused.
The same delivery recorded twice creates no second lot and no second increase. Lots are never edited.
Architectural guidance
Stock raised by the grams ordered is wrong on every short delivery and stays wrong until a count. A delivery recorded twice, from a retry or a driver's second scan, doubles the stock and hides a shortage for weeks. A lot that can be edited breaks the trail an inspector may ask for.
Acceptance criteria
An invoice names the order and the delivery it bills, with lines in grams and prices. It is matched when every invoiced quantity is at most the grams received and every price is at most 2% above the order's price. Otherwise it is held, with a reason: short delivery, price over tolerance, or no delivery. When several reasons apply the order of precedence is no delivery, then short delivery, then price. A line ordered at 1,200 cents per kilogram passes at 1,224 and is held at 1,225.
An invoice that arrives before its delivery is held as no delivery and is matched on its own once the delivery is recorded. The same invoice sent twice is one record. Resolving a held invoice, for example with a credit note, is outside the brief.
Architectural guidance
Rejecting an early invoice for good loses a legitimate bill, and a price accepted without a limit lets a supplier raise prices one invoice at a time. The group wants every held invoice to carry the reason, so that the person phoning the supplier knows what to say.
Acceptance criteria
A count names a site, an ingredient, the counted grams and who counted. Stock afterwards equals the counted grams, and the difference is recorded as a new entry. Stock at minus 1,200 grams and a count of 8,000 grams give a difference of 9,200 grams and a figure of 8,000. Counts add to the history: two counts in a row keep both, and a count equal to stock records a difference of 0. A negative count is refused. A count edits no earlier entry and changes no lot.
Architectural guidance
A count is how the group admits the stock figure was wrong, and the size of the difference is the thing the owner wants to read. A count that overwrites the figure hides how wrong it was and who found out. A figure that is silently adjusted makes the next usage report impossible to explain.
Acceptance criteria
Cooking uses lots oldest first, and the product says in plain words that this is an approximation, because a kitchen cannot know which lot went into which plate. The cost of each firing is the grams used from each lot times that lot's price per kilogram, divided by 1,000, rounded half up per lot. With a lot of 5,000 grams at 1,200 cents per kilogram and a later lot at 1,260, a firing of 6,000 grams costs 6,000 plus 1,260, which is 7,260 cents, and shows both lots.
Grams used beyond any lot on hand are costed at the most recent lot's price and counted as unallocated. The owner can read the cost of what was cooked for a site and a day.
Architectural guidance
A food cost taken from today's price rewrites last month's margin whenever a supplier changes a price. A cost that ignores which lot was used overstates the dish when prices fall and understates it when they rise. The group accepts an approximation and wants the product to say so.
Acceptance criteria
One documented command prints the number of checks and 0 differences. The simulator plays three suppliers: one delivers 18,000 grams against 20,000 and invoices 20,000, one invoices one line exactly 2% above the order and another 3% above, and one sends its invoice before its delivery. Every request is sent twice and every call is retried.
The short delivery raises stock by 18,000 grams and its invoice is held as short. The line 2% over passes and the line 3% over is held. The early invoice is held and then matched once the delivery is recorded. A day's cooking across two lots is costed oldest first, and the grams taken from every lot add up to the grams used plus the unallocated. Stock recomputed independently from the deliveries, cooking, waste and counts equals what the product shows, and each lot's remaining grams equal the grams received less the grams taken, none below zero. A count in the middle leaves stock equal to the counted grams.
Run the test once against a build that raises stock by the ordered grams and record the output.
Architectural guidance
The three documents of one purchase disagree on purpose in this test, and every request is sent twice, which is how a supplier's system behaves on a bad day. A check that recomputes stock apart from the product catches the product agreeing with itself. A short delivery that raises stock by the ordered grams passes every test that only reads one document.
Architectural walkthrough
One purchase leaves three documents: the order the group sent, the delivery that arrived and the invoice the supplier billed, and they disagree. A supplier delivers 18,000 grams against an order of 20,000 and invoices 20,000. Paying the invoice because the order existed pays for grams that never arrived.
Stock has to rise by what arrived, not by what was ordered. A figure raised by the order is wrong from the first short delivery, and nobody notices until a count. A count is how the group admits the figure was wrong, and it must leave the history readable rather than rewriting it.
Suppliers send documents in the wrong order. An invoice can arrive before its delivery, and a delivery can be sent twice. A product that raises stock twice, or rejects the invoice for good because it came early, overpays or loses a bill.
A kitchen cannot know which lot went into which plate. The group accepts that and uses lots oldest first, which is an approximation, and takes the cost of a dish from the price actually paid. The cost of a wrong approximation is a food cost the owner trusts and should not.
Take payments and split bills
Produces card and cash payments against a closed check, splits that settle once, tips taken with the card payment, refunds approved by a named manager, drawer counts and the no-show fee. Staff pay-outs and offline card limits wait for later Phases.
Acceptance criteria
A payment is refused, with nothing stored, for an order whose check is not closed. A platform order has no payable check, because the platform pays the group through its settlement.
A terminal asks for a card payment for an order, with the amount in cents and a card token returned by the simulator's card reader. The product keeps the token and the last four digits and nothing else about the card. A search of everything the product stores, logs or sends for the full test card number finds nothing. Staff see plain outcomes such as paid, declined or timed out, never a processor's status code or field name.
The processor simulator can decline a chosen test card, and can take the money and then give no answer for 10 seconds. A decline fails the payment with the reason declined. A payment with no answer after 10 seconds shows as waiting for the processor, and one still unresolved after a retry fails with the reason timeout. In both cases the check stays open for another payment.
The same payment sent twice is one payment and one charge on the simulator's own count. When the simulator takes the money and then goes silent, the retry ends with one captured payment and one capture. Kill the product after the capture and before it has stored the answer: after the restart the payment shows as waiting for the processor and resolves to captured, with no second charge.
Architectural guidance
A processor can take a guest's money and then not tell you. If the product forgets the payment when it is killed at that moment, nobody knows what was charged, and a retry charges the guest again. Card details are the other risk: a number that reaches a log or anything the product sends stays there, and the group becomes responsible for it.
Acceptance criteria
A closed check can be paid in parts, by card or cash. A check of 18,600 cents paid with 7,000 by card, 6,000 by card and 5,600 in cash stays unsettled after two parts and settles when the third is taken. It settles once, with the three parts listed and adding up to 18,600 cents; tips are not part of the total. A settled check shows settled at the terminal. A check closed at 0 settles at once with no payments.
A part counts against the balance from the moment it is started. Two terminals asking at once for the last 5,600 cents give one accepted and one refused, with nothing stored for the refused one. A part larger than the balance is refused. A declined part gives its share back, leaves the parts already taken alone, and the 6,000 can be paid again by another card or in cash. The last part sent twice, or two requests racing to complete the check, produce one settlement.
Cash needs an open drawer, opened with a float in cents; with no open drawer cash is refused. Counting a drawer takes the counted cents and records the expected cash (float plus cash taken on that terminal minus cash refunded), the counted cash and the variance (counted minus expected). A variance of more than 500 cents either way is flagged, and exactly 500 is not. Counting twice keeps both counts.
Architectural guidance
Two terminals can each see 5,600 cents left on a check and each take it, and the guest is charged for more than the bill. A declined part that is not given back to the balance leaves a check that can never settle, which then holds up the day close. A drawer count that overwrites the one before it hides the shortfall the manager needs to see.
Acceptance criteria
A card payment carries the tip the guest chose on the card terminal before paying, and the tip is part of the captured amount. A part of 6,000 cents with a tip of 800 is one capture of 6,800 cents, and the payment shows 6,000 cents against the check and 800 cents of tip. A tip of 0 is a payment with no tip. A negative tip, or one that is not a whole number of cents, is refused with nothing stored. A declined or timed-out payment carries no tip.
Card captures are grouped into a batch per site that opens with the first capture after the previous batch closed and closes when the simulator is told to close it. The batch shows the card total (without tips, net of refunds), the tips total and the payment count. Closing an empty batch, or the same batch twice, does nothing new. A payment refunded after its batch closed puts a negative amount in the batch that is open at the time of the refund.
A tip entered wrongly is corrected by a manager-approved refund of the original payment in full (amount and tip) and a new charge of the stored card for the same part with the right tip: the 6,000-cent part with an 800 tip is refunded as 6,800 cents and charged again as 6,000 plus a tip of 500. Kill the product between the refund and the new charge: after the restart the new charge happens once. The check stays settled and is never settled a second time, the original payment and its tip stay readable beside the refund, and the tip total for the payment is the corrected tip.
Architectural guidance
A tip kept apart from the capture can disagree with the amount the guest approved on the terminal, and the staff are paid from a figure the card batch does not show. Correcting a wrong tip moves real money twice, and a product killed between the two steps leaves a guest refunded and never charged again, or charged twice. Either way staff are short of a tip they earned, or the guest pays for it twice.
Acceptance criteria
A manager refunds one line of a captured payment, naming the payment, the line, the terminal and themselves (staff identifier and role as asserted at the login, not verified). The refund equals that line's amount from the closed check, shows no tip and the reason line refund. A card refund goes to the processor and lowers the open card batch. A cash refund lowers the expected cash of the open drawer on that terminal. The original payment is unchanged and shows its refunded total beside it.
A non-manager is refused and nothing is stored. A line refunded once is refused the second time. A refund larger than what remains of the payment is refused, and a line paid by the second card of a split is refunded against that card. The same refund sent twice is one refund, and the processor is asked once. A processor that takes the refund and then does not answer is not asked to refund twice on retry.
Stock is untouched by a refund, because the dish was cooked. After a check is closed, a refund is the only way to take money back.
Architectural guidance
A refund that edits the payment it reverses leaves no trace of what the guest first paid, and the drawer and the batch stop adding up. A retried refund that reaches the processor twice gives the guest their money back twice. Without a named manager, nobody can say who approved giving money back.
Acceptance criteria
A booking can carry a card guarantee. The booking shows the last four digits of the card. No card number or token appears with the booking, in a search of what the product stores, or in anything it sends.
When a booking with a guarantee is marked a no-show, the product charges the party size times 1,500 cents once per booking: 6,000 cents for a party of 4. The fee appears in the open card batch and in no sales figure, because it is not a sale of dishes. A no-show marked twice, or by two hosts, is one charge. A processor that takes the fee and does not answer is retried without a second charge. The booking shows that the fee was taken, and a second no-show mark changes nothing.
A no-show with no guarantee charges nothing. A declined guarantee card charges nothing and leaves the failure visible to a manager.
Architectural guidance
A no-show fee that fires twice charges a guest 12,000 cents for a table that stood empty, and the guest disputes it with their bank. A fee counted as a sale inflates the day's takings and the owner's prime cost percentage. Card details kept next to a booking sit where far more people can see them than the payment needs.
Acceptance criteria
One documented command builds a closed check of six guests for 18,600 cents paid in three parts. The simulator takes one card part and then gives no answer for 10 seconds, and declines the second card part. The test retries the timed-out part, pays the declined 6,000 in cash, then repeats every request twice in a different order.
The command prints the simulator's count of captures: exactly one per successful card part, with the timed-out part taken once. The check settles exactly once, after the cash part and not before, with the parts adding to 18,600 cents. In a second scenario the declined part is never replaced: the check stays unsettled after every repeat and after a 24-hour clock jump.
The test kills the product between the processor's capture and the stored answer several times with different timings. No part has two captures and no check settles short. With card payments stopped for a stretch, guests can still be booked, orders taken, tickets bumped and checks closed, and payments proceed after the restart.
The results are committed. Run the command once against a deliberately broken build that charges again on every retry, and commit that output too: it shows a part captured twice.
Architectural guidance
Every request in this Phase can arrive twice, late or not at all, and the damage shows up only in combination: a timeout, a decline and a retry on one bill. A check that settles short is money the group never collects, and a part charged twice is a guest on the phone. With card payments down, a restaurant that can no longer seat or cook has lost the evening to a problem that should only delay the payment.
Architectural walkthrough
The card processor is an outsider, and the group does not control what it does. It can take a guest's money and then fail to answer for 10 seconds. You write the processor simulator yourself, and it behaves as this Phase describes.
A payment that is retried after silence can charge the guest twice. A product killed after the processor took the money and before it noted the answer leaves nobody knowing what was charged, and the guest finds out from the bank statement. Both cost the client a refund, a phone call and a guest who does not come back.
A split bill adds a second failure. Two terminals asking for the last 5,600 cents of an 18,600 cent check at the same moment can both be told yes, and a declined part can leave a check that looks paid and is not. A check that never settles blocks the day close, and a check that settles short is money the group never collected.
A tip travels inside the captured amount, so a tip entered wrongly can only be corrected by moving the money twice, and staff are short of that tip until it is. A refund that changes the payment it reverses makes the drawer and the card batch disagree with each other at close.
Schedule staff and pool tips
Produces rosters that obey the rest rules, shift swaps, clock-in and clock-out with labour cost, pooled tip shares and a test that runs with other capabilities stopped. It computes no pay and no premium rates.
Acceptance criteria
Staff have an identifier, a role (server, cook or manager) and an hourly rate of 1,500, 1,800 or 2,500 cents. A roster is a week of shifts for a site, and a roster that follows the rules is stored.
The rules are at least 11 hours of rest between one person's consecutive shifts, counted across sites and across the boundary with the previous week; a 30-minute break on a shift longer than 5 hours 30 minutes; and at most 48 hours of scheduled work in a roster week, net of breaks. A roster that breaks any rule is refused whole with nothing stored, and the refusal names every violation by person, shift and rule.
A shift ending at 20:00 followed by one starting at 07:00 leaves exactly 11 hours and is accepted; 06:59 is refused. Overlapping shifts are refused, and so is a role the person does not hold. In Amsterdam, a shift ending at 01:00 on the night the clocks go forward followed by one at 12:00 the same day is 11 hours on the wall clock and 10 elapsed, and is refused. A shift of exactly 5 hours 30 minutes needs no break and one of 5 hours 31 minutes without a break is refused. The same pair on the night they go back leaves 12 hours and is accepted. A published roster is not edited; changes go through swaps.
Architectural guidance
A rest rule checked only in a report finds the tired cook on Monday, after the shift. Wall-clock arithmetic is wrong on the two clock-change nights, which are the busy weekends the rules exist for. A roster that is half stored when it is refused leaves the manager looking at a rota nobody agreed to.
Acceptance criteria
A manager reassigns a shift to a person of the same role. It is accepted only if the replacement's whole roster still obeys every rule with the shift added: 11 hours of rest before and after, the 30-minute break, no overlap and at most 48 hours in the roster week. The earlier assignment stays in the shift's history.
A replacement who worked until 01:00 and is offered a shift at 11:00 the same day is refused, and the shift stays with its owner. A replacement at 46 scheduled hours offered a 4-hour shift is refused; at 44 it is accepted. A different role is refused. A refused swap changes nothing. The same swap sent twice is one reassignment.
Removing a shift never creates a violation for the person who loses it: swapping away the middle shift of three consecutive days is accepted. No premium pay and no pay is computed.
Architectural guidance
A sick call comes at 14:00 and the manager has minutes to find a cook, so the first person who says yes is often the one who closed last night. A swap that checks only the new shift, and not the week around it, quietly breaks the rest rule the roster was built to keep.
Acceptance criteria
A person clocks in against a rostered shift of their own and clocks out later. Minutes worked are the whole minutes between the two moments, with seconds dropped. Labour cost is the minutes times the rate in force at clock-out, divided by 60 and rounded to the nearest cent with halves up: 437 minutes at 1,500 cents costs 10,925 cents.
Both records carry the business day of the clock-in. Clock-in at 18:00 Friday and clock-out at 05:10 Saturday with a 04:00 cutoff is Friday and 670 minutes. A shift worked across the night the clocks go back, from 22:00 to 06:00, is 540 minutes, not 480.
A clock-out without a clock-in is refused. A second clock-in or a second clock-out adds nothing. Nobody without a rostered shift can clock in, and a shift that is clocked in cannot be reassigned. A manager can record a clock-out for someone who forgot, at a stated earlier moment; the record names the manager and is added without editing what was there.
Architectural guidance
A shift that runs past the cutoff lands on the wrong day if the clock-out decides the day, and the labour cost of a busy Friday moves to a quiet Saturday. The prime cost the owner reads is only as good as these minutes. A forgotten clock-out left uncorrected books a shift of 30 hours.
Acceptance criteria
One documented command runs two tests. The first feeds a long series of roster publications and swaps chosen to hit the edges: exactly 11 hours of rest; a shift of exactly 5 hours 30 minutes and one of 5 hours 31 minutes without a break; 48 hours exactly and 48 hours and a minute; and both clock-change nights. A checker written separately from the product's own checks reads the published rosters after every request and finds zero violations. Every refused request leaves the rosters unchanged, counted before and after.
The second test stops booking, card payments, ordering, stock and every other capability except staff scheduling, once the sites and some tips exist. It then publishes a roster, swaps a shift, clocks a shift in and out across the cutoff and shares a pool, and all of it works. When card payments restart, a new tip correction and a repeat of an earlier one arrive, and the tip totals change exactly once.
The results are committed. Run the first test once against a deliberately broken build that lets a swap skip the rest check, and commit that output: it shows the first test failing.
Architectural guidance
Rest rules fail at their boundaries: the 11th hour, the 5 hour 30 minute mark, the 48th hour, and the two nights the clock moves. A test that only tries comfortable cases passes a product that breaks on the first clock-change weekend. A rota that depends on booking or card payments to run turns a failure somewhere else into a Friday where nobody can change a shift.
Architectural walkthrough
Rest rules have to hold at the moment of every change. A cook who finishes at 01:00 and is swapped into a shift at 11:00 has had 10 hours of rest, and the manager who made the swap did not do the sum. The damage comes from the third swap of the week, when nobody is looking at the whole roster. It costs the group a tired cook and a breach of its own house policy: 11 hours between shifts, a 30-minute break on a shift longer than 5 hours 30 minutes, and at most 48 hours in a roster week net of breaks.
Clocks make the arithmetic wrong on two nights a year. On the night the clocks go forward, 11 hours on the wall clock is 10 hours of rest. A shift worked across the night they go back is 540 minutes, not 480. A shift belongs to the business day it started on, even when it ends after the 04:00 cutoff.
The third problem is tips: the shares for a night must add up to the pool to the cent, and staff compare their shares. A share that is a cent out, or a tip refunded after the shares were given, starts an argument the manager cannot settle from the records.
Staff scheduling also has to keep working on a Friday when booking or card payments are stopped. A rota that cannot be changed because another capability is down is worse than the spreadsheet it replaced.
Take online orders
Produces online orders from the delivery platform, received once, accepted or rejected against live availability inside the platform's 3 minutes, a platform menu kept in step within 10 seconds, missed orders found, and the platform's settlement reconciled. Working while cut off from the cloud waits for the next Phase.
Acceptance criteria
The platform simulator, which you write, uses its own field names and its own way of writing money, and delivers each new order by webhook. The group answers the webhook and matches the platform's items to its own dishes. No platform field name or status word appears in anything staff or the reports show.
The same webhook twice makes one order, with the platform's own order number deciding which is which. A malformed body is refused and nothing is stored. An order for a store or an item the group cannot match is not cooked and is rejected as the next Checkpoint describes.
Architectural guidance
The platform sends the same order twice whenever it is unsure the first one arrived. Two copies mean two meals cooked and one paid for. The platform's own wording on a staff screen or a report is something staff have to decode on the busiest night.
Acceptance criteria
An order is accepted when every line is on sale (published, not withdrawn, not 86'd by the chef, not sold out) and every limited line fits the portions given to the delivery platform, one per unit. Accepting takes those portions at once, prices the order from the group's menu and tells the platform. The kitchen and the reports see it as a platform order with 1 cover, no seating and no terminal. Delivered again, it makes one order and takes no second portion.
Rejecting tells the platform the reason: dish unavailable, naming the dishes, or accept window expired. The 3-minute window runs from the platform's creation of the order, not from when the group received it. An order arriving with 10 seconds left is accepted if it can be. After the window it is rejected and takes no portions.
With the platform's portions empty and stock unreachable, the dish counts as sold out for the platform and the order is rejected as unavailable. An unknown store or item is rejected as unavailable. An order of one available dish and one 86'd dish is rejected whole, and the available limited dish's portions are unchanged. Run with stock stopped to show the decision still happens in time.
Architectural guidance
The platform gives 3 minutes and does not wait. A half-accepted order, with portions taken for one dish and the other refused, leaves portions nobody can sell.
Acceptance criteria
The platform simulator can lose a webhook on request and can list its recent orders. An order whose webhook was lost is found within 60 seconds on the simulator's clock and is accepted or rejected by the same rules, with the window counted from the platform's creation time. A lost order found 50 seconds later with 2 minutes 10 seconds left is accepted.
The same order arriving by webhook and found by the group in the same second is one order. An order found after the window is rejected as window expired, takes no portions and is reported to the platform. If the platform is down when the group looks, nothing crashes and no order is skipped. A look that finds nothing changes nothing. After a restart the same orders are not treated as new.
Architectural guidance
Webhooks get lost, and the platform does not say so. A lost order is a guest charged for food that never arrives, and the group learns about it from the phone call. Finding an order the group already has must not make a second meal.
Acceptance criteria
The platform simulator produces a settlement listing for a site and a business day: each order it considers paid, with its order number, the order value in cents and the amount it pays after a 20% commission, the value times 20% rounded to the nearest cent with halves up. An order of 2,745 cents expects 2,196 cents.
The group compares a listing with the orders it accepted and reports each discrepancy, of three kinds: an accepted order missing from the listing (expected amount, 0 paid); a listed order whose amount differs from the total minus the commission, such as a listing that pays 2,200 for the order above; and a listed order the group has no accepted order for, which is an order the platform charged and the group never received, or one the group rejected and was paid for (expected 0). The discrepancy for an order the group never received carries the business day of the platform's order time.
Importing the same listing twice reports each discrepancy once. A clean listing reports nothing. A rejected order the platform does not list reports nothing. Resolving a discrepancy with the platform is outside the brief.
Architectural guidance
The platform keeps 20% and pays the rest, and the group has only the platform's word for the sum. An order the platform paid for but the group never cooked, or cooked and never got paid for, is invisible unless someone compares the two lists. A cent of rounding on each of 108 orders a day adds up.
Acceptance criteria
One documented command, using the simulator's clock, has the chef 86 a limited dish, and a minute later the platform sends an order for it. The order is rejected as unavailable, naming the dish; the rejection reaches the platform; no portion is taken; nothing is accepted and the kitchen has no order or check for it.
The same command covers an order for a dish whose last portion sold on a terminal 5 seconds ago (rejected); an order while the platform's portions have run out and stock is stopped (rejected); an order of one available dish and one 86'd dish (rejected whole, portions unchanged); and an order delivered twice (rejected once).
Then the platform holds 4 portions of the lamb special, with 4 held by each of two terminals out of 12, and 6 single-portion orders arrive at once, some as duplicate webhooks. Exactly 4 are accepted and 2 are rejected as unavailable, and the kitchen holds 4 platform orders, each once. The results are committed.
Architectural guidance
The race in this Phase sits between two things that each look right: the chef's 86 and the platform's order a minute later. Without the test, the group finds out about the gap when a guest is charged for a dish that was off the menu. An order accepted twice during a race is two meals promised from one portion.
Architectural walkthrough
The delivery platform is an outsider with its own rules. The platform in this brief gives the group 3 minutes from its own creation of an order to accept it (real platforms allow about 10, so the short window is the simulator's, chosen to make the deadline bite), keeps showing a dish until told otherwise, and never waits for the group to check stock. You write the platform simulator yourself, with its own field names and its own way of writing money, and it behaves as this Phase describes.
The platform sends the same order twice, loses an order, and delivers one late. A guest can be charged by the platform for an order that never reached the group, and the group finds out when the guest phones. An order accepted twice is two meals cooked and one paid for. An order accepted after the dish ran out is a guest waiting for food nobody can make.
Deciding takes time the platform does not give. If the group can decide only when stock answers, and stock is slow or stopped, the window closes and the order is lost, or the group accepts blindly and sells a dish that is gone.
About 15% of covers are online orders, around 108 a day for the group. The platform deducts a 20% commission, so the money it pays is a figure the owner has to check. A difference of a few cents on each order adds up across 108 orders a day.
Keep trading without the cloud
Produces terminals that keep selling and taking cash and limited card payments while cut off from the cloud, tickets that still reach the kitchen display, a catch-up that never duplicates, and conflicts resolved by rule. The day close and the reports wait for the next Phase.
Acceptance criteria
A simulator switch cuts every terminal off from the cloud while terminals and kitchen displays can still reach each other. Cut off, a terminal places an order for a table seated before the cut, each line at the price on the last published menu; fires courses; voids or comps with a manager asserted at login; closes the check; and takes cash. A table not seated before the cut cannot start a new order offline: the terminal says why and nothing is stored.
Kill the terminal in the middle of writing an order. After the restart every finished order, fired course and payment is present once, the interrupted order is whole or absent, and nothing appears twice. A void is a new entry beside the order; the placed order reads as it was.
Architectural guidance
A terminal that stops working when the connection drops stops the restaurant, and one whose work vanishes in a crash loses every order taken since the cut. An order half written at the moment of a crash is either lost or served twice. The kitchen depends on the order being right the first time, because nobody can ask the guest again what they ordered.
Acceptance criteria
With the connection up, tickets reach the kitchen as before. Cut off, a course fired on one terminal appears on the correct station's display within 5 seconds, and a second terminal's course appears on the same display, with no help from the cloud.
A display shows a ticket once even when it is sent twice, and cooks can bump and recall with the cloud cut off, with prep time still recorded. After a display restart in the middle of the outage it shows its unbumped tickets again, and a display switched on late shows the unbumped tickets for its station. When the last ticket of a course is bumped, the next course fires by rule; a course fired offline and again on return is not fired twice. A bump on two displays is one bump.
After the cloud returns, the display's tickets and bumps reach the kitchen once each. The failure of the local network itself is outside the brief.
Architectural guidance
A kitchen display that depends on the cloud goes blank in an outage while the dining room is full. When two terminals each sell to the same grill and the grill sees only one, a table waits for food nobody is cooking and the guest asks where it is. A display that restarts and forgets what it was showing makes the same table wait again.
Acceptance criteria
When the connection returns, a terminal's work from the outage reaches the group in the order things happened and is recorded exactly once. A catch-up sent twice, sent again because the reply was lost, or interrupted halfway and then resumed adds nothing twice and loses nothing. The same action arriving twice counts once.
Records made from a catch-up keep the moment the action happened and show the later moment the group learned of it: an order rung 80 minutes ago shows 80 minutes between the two. The business day follows when it happened, and the visit stays the same. Card payments in the backlog go to the processor once each, and a decline fails the payment with the reason declined and leaves the check unsettled for the day close to show.
A void that arrives before the order it voids is applied after the order. Two different actions on the same thing are a conflict, which the next Checkpoint resolves. Portions a terminal sold from its share are accounted for exactly once.
Architectural guidance
A terminal cannot know whether its last send arrived. If the group adds whatever it receives, a dropped reply turns into duplicate orders and a guest charged twice. If it treats the arrival moment as the moment of sale, Friday's dinner lands on Saturday and the owner's figures are wrong.
Acceptance criteria
Offline, a terminal sells a limited dish only from the portions it holds, and only for 30 minutes after it was given them. Terminal A given 4 sells 4 and refuses the fifth as sold out, even though terminal B has 2 unsold. A terminal given its portions 20 minutes before the cut sells for 10 more minutes and then refuses, with portions unsold. No top-up is possible offline.
Card payments offline are accepted up to 15,000 cents each (15,000 accepted, 15,001 refused with the instruction to take cash or wait) and 150,000 cents in total per terminal per outage, counting amount and tip. The next payment after 150,000 is refused. Cash is unlimited. The running total starts at the first offline card payment and resets when its catch-up is complete. Refunds and tip corrections are refused offline.
A card payment above the limit that arrives from a modified terminal is not sent to the processor and fails with the reason over offline limit. After a catch-up the portions the terminal reported sold stay sold and the rest return; portions it never reported stay counted as sold.
Architectural guidance
A terminal that can sell anything while cut off sells the last lamb shoulder to three tables. A terminal that can take any card payment offline takes ones the processor later declines, and the group has fed a guest for nothing. The limits exist so the worst night costs an amount the group chose in advance.
Acceptance criteria
When two terminals acted on the same thing while cut off, the earlier action stands and the later one is compensated automatically. Each conflict is listed with both actions, their terminals and moments, and what the group did about it.
The same check paid in full on two terminals offline: the earlier payment stands, the later is refunded in full (amount and tip) with the reason conflict, through the processor if it was a card and shown as approved by the system, and the check settles once. A void on one terminal and a payment of the check on another: when the payment is earlier, the void is refused as a conflict and the line stays.
A dish the chef 86'd while a terminal was cut off, and the terminal sold it after the 86: the sale stands, the kitchen ticket for that line is flagged, and the conflict list names the sale and the 86. A sale before the 86 is not a conflict. Catching up in the other order gives the same result. Repeating the same catch-ups creates no second refund and no second entry in the list. Actions that do not conflict, such as two payments of different checks, produce no entry, and the catch-up summary counts the conflicts it found.
Architectural guidance
Two terminals that cannot see each other will sometimes both take the last of something. If the group decides by whichever catch-up arrives first, the outcome depends on whose connection came back first, and the same night replays differently. A guest charged twice for one check costs a refund and an apology, and a conflict nobody listed is one the manager learns about from the guest.
Acceptance criteria
One documented command runs a scripted dinner at one site with several terminals and displays, twice: once clean and once with a 90-minute outage during dinner that cuts every terminal off and then restores them.
During the outage the script takes orders; fires and bumps courses; voids lines; takes cash; takes card payments, including one of 15,001 cents and enough to reach the 150,000 total; sells a limited dish from held portions; has the chef 86 a dish; pays one check on two terminals; kills a terminal process once; and repeats a catch-up after dropping its reply.
After the catch-up every order, line, payment and ticket the terminals recorded exists once and none is missing. Check totals, settled checks and sold portions match the clean run except for the planted cases. Portions sold never exceed portions given. Each planted conflict is listed once and the count matches. Card payments rejected for the limit are absent; payments the processor declines on catch-up are listed with their checks unsettled; the doubly paid check's second payment is refunded once with the reason conflict. The results are committed.
Run once against a deliberately broken build that records a catch-up again each time it arrives, and commit the output: it shows duplicates.
Architectural guidance
The failures in this Phase only hurt in combination: an outage long enough to matter, a restart, a dropped reply, a dish 86'd while it was being sold. A Friday outage with any one of them loses an order or doubles a charge, and the group learns about it from the guest. Comparing against a night with no outage is the only way to say what the outage cost.
Architectural walkthrough
On a Friday the group's cloud went down for about an hour and a half. Each terminal held only its own orders, so the grill never saw what the second terminal took. The last lamb shoulders were sold three times, and when the connection came back nobody could say which orders were duplicates.
A terminal that is cut off can only act on authority it was given in advance: portions of a limited dish handed to it earlier and good for 30 minutes, card money up to a cap of 15,000 cents a payment and 150,000 cents a terminal per outage, and any amount of cash. That bounds the loss from a wrong terminal to numbers the group chose beforehand, instead of to whatever the terminal believed.
When the connection returns, each terminal has a backlog of what happened, sent long after the fact. A backlog that arrives twice, half sent or out of order must not turn a 90-minute outage into duplicate checks and double-charged guests. Two terminals can also have made promises that cannot both hold: the same check paid on both, or a dish 86'd while one terminal was still selling it. The kitchen then fails to cook what was ordered, a guest is charged twice, and a manager reconciles the night by hand.
Close the day and report
Produces daily figures per site and for the group, prime cost, usage variance, the day close with the Z report and corrections for late sales, and a reconciliation of drawers and card batches. It adds no new sources of sales and does not export to accounting.
Acceptance criteria
For each site and business day, and for the group, the reports show gross sales (the sum of closed check totals, platform orders included, already after voids and comps), voids priced at line price times quantity, comps, refunds, covers, checks and tips. Refunds count on the refund's own business day: a Saturday refund of a Friday sale lowers Saturday's net sales and leaves Friday alone. Net sales are gross minus refunds. Tips belong to the business day of the original payment (tips captured minus tips refunded, a correction counting as a refund and a new capture). A platform order counts 1 cover, and a second round does not count the party again.
The group figure is the sum of the sites. After a terminal catch-up that delivers the same sales twice or in a different order, the figures equal those of an in-order run. An order rung at 01:30 on Saturday is in Friday's figures and none of Saturday's, also on both clock-change nights. A check closed at 0 counts as a check and adds no sales. A platform order adds a cover and sales and no payment. A refund caught up before the payment it refers to still ends with the in-order figures.
A sale that reaches the group after the cutoff that ends its business day is listed as late, with how late, and marks the day as changed after the cutoff: an order rung at 01:30 that reaches the group at 02:00 is not late, and at 09:00 it is. A site's cutoff changed later leaves already recorded facts on their date.
Architectural guidance
Report by calendar date and Friday dinner splits across two days, so the owner thinks Friday was slow and Saturday busy. Figures that depend on the order in which sales are heard change when a catch-up lands hours late, and the owner reads a different Friday on Monday than on Saturday. A late sale folded in silently changes a day somebody has already signed.
Acceptance criteria
Per site, business day and for the group, the reports show labour cost (the sum of shift labour cost on each shift's clock-in business day), food cost (the cost of what was cooked from the lot prices, oldest first, an approximation the report states in plain words; use beyond the lots on hand is costed at the latest lot price and counted) and prime cost, which is food plus labour. Each is also shown as a percentage of the day's gross sales to one decimal, rounded half up.
Food outside 25% to 35% and labour outside 25% to 33% are marked. Prime cost is shown against the 60% target and flagged above 65%. With 1,000,000 cents of sales, 330,000 food and 280,000 labour, the report shows 33.0%, 28.0% and 61.0% with no flag; 66.0% is flagged and exactly 65.0% is not. A day with no sales shows no percentage and does not fail.
The group figure is the sum of cents first and the ratio after: S01 with 800,000 sales and 480,000 prime cost is 60.0%, S02 with 200,000 and 150,000 is 75.0%, and together they are 63.0%, not 67.5%. A shift in on Friday and out after the Saturday cutoff counts in Friday. For a person still clocked in the report shows the labour of closed shifts so far and the number of open shifts.
Architectural guidance
Prime cost is the figure the owner reads before anything else, and it is easy to get wrong in ways that look right. Averaging the sites' percentages gives 67.5% for a group that spent 63.0%. Food cost from a lot price the kitchen cannot trace to a plate is an estimate, and saying so in the report is what stops it being read as a measurement.
Acceptance criteria
Per site and ingredient, over the span between its two most recent counts (each taken at the end of a business day), the report shows theoretical usage (the grams cooked minus the grams of dishes voided after firing), actual usage (opening count plus grams received minus closing count) and the variance (actual minus theoretical).
An ingredient is listed when the variance, in either direction, exceeds 3% of its theoretical usage. With 80,000 g theoretical, an opening count of 50,000 g, deliveries of 100,000 g and a closing count of 66,000 g, actual usage is 84,000 g: a gap of 4,000 g, or 5.0%, and it is listed. 10,000 g theoretical and 10,300 g actual is exactly 3.0% and is not listed. An ingredient with no theoretical usage and some actual usage is listed. With no opening count the ingredient shows as not comparable.
The list is ordered by the variance in cents using the latest delivery price and shows beside each entry the spoilage waste in the span and the grams costed as unallocated. A late count or delivery that lands in the span changes the report, and the report says so. The report says variance is a signal and does not say why.
Architectural guidance
Over-portioning, waste and theft look the same on paper: the count is lower than the recipes say it should be. A report that names a cause is wrong half the time and accuses the wrong person. A delivery entered after the report ran makes the kitchen look careless for a loss it did not cause.
Acceptance criteria
A manager requests the close of a site's business day and sees the blockers: an open check (a terminal order not closed or not settled), an open drawer (cash taken and no drawer count) and a person still clocked in. A platform order never blocks. A check whose lines were all voided by a named manager closes at 0, settles with no payments and clears. The close waits and rechecks as things are resolved; a request with a blocker lists it and the day stays open.
When no blocker remains the day closes and the Z report is issued with gross sales, covers, tips, checks, voids, comps, tender totals for cash, card and platform, and optionally refunds. Cash and card are net of that day's refunds, and cash plus card plus platform equals gross sales minus refunds. Closing the day closes the site's card batch if it is still open. A second request changes nothing.
A sale for a closed day never reopens it and never edits the Z report. It produces a correction that names the Z report, the late sales and the change in gross sales (optionally covers and tips), and the Z report plus its corrections equals the current figures for that site and day.
Architectural guidance
A day closed over an open check or an uncounted drawer is a Z report that is wrong on Monday morning, with nobody able to say why. A Z report that quietly changes after it was signed cannot be relied on by the person who signed it. A late sale that is thrown away is money in the till that appears in no report.
Acceptance criteria
For each drawer count, the expected cash is recomputed from the float plus cash taken on that terminal in the drawer's open span minus cash refunds, and compared with what the drawer recorded. For each card batch, the card total, tips total and payment count are recomputed from its payments and refunds and compared. Every difference is listed by drawer or batch, and a batch off by one cent is reported.
Drawers with a variance of more than 500 cents either way are listed: 500 is not flagged and 501 is. Card payments taken on a terminal in the span that appear in no batch, and cash payments with no drawer count, are listed. A later correcting count for the same drawer appears as a second entry and the first stays.
A refund of a payment in a closed batch appears in the batch that is open at the time of the refund. A card payment caught up after the day closed appears in the open batch and not the earlier one. Running the reconciliation twice gives the same result. A day with no drawers or batches gives an empty result and no error.
Architectural guidance
Cash and card each have a second record kept by someone else, the drawer count and the processor's batch, and they only help if somebody compares them. A drawer that is 600 cents short with nobody noticing, or a batch that does not match the payments behind it, is how a small loss becomes a habit. A payment caught up after the day closed that lands in the wrong batch makes both batches wrong.
Acceptance criteria
One documented command runs a full simulated day for the three sites through the whole product, including a clock-change day and an order rung at 01:30, and closes each site's day. The test computes expected sales, covers, tips, labour, food cost and Z report totals from the simulator's own record of what it did, with its own simple code, and checks the reports for each site, business day and the group. It checks tips against the shares given out, batch totals against the batch records and labour against the clock-outs.
It adds a late sale to a closed day and checks that a correction appears and that the Z report plus corrections equals the current figures. It then discards the reports, keeps everything the group recorded and restores the reports: every figure, Z report and correction is the same as before. It repeats with a terminal catch-up that arrives in a shuffled order and with duplicates, and gets the same figures.
With every other capability stopped, the reports of past days stay readable and can be restored. The results are committed. Run once against a deliberately broken build that groups by calendar date, and commit that output: it shows a mismatch for the 01:30 order.
Architectural guidance
A report is checked only against itself unless something computes the answer another way. A test that adds up the day separately finds the Friday that is out by one order. Reports that cannot be restored from what was stored are figures the owner has to take on trust the day something is lost.
Architectural walkthrough
A day is a business construct, 04:00 to 04:00, and the owner's figures have to follow it. A terminal's catch-up can land Friday's orders on Saturday morning, and a report grouped by calendar date makes Friday look quiet and Saturday busy. The bookkeeper uses the calendar date, the owner uses the business day, and they disagree about the same takings.
A closed day has to stay as issued. A manager signs the Z report, the end-of-day sales summary, and a sale that reaches the reports afterwards must not change it silently. The late sale is real money the report did not include, so it appears as a correction that names the Z report it corrects. A Z report that changes after it was signed is worth nothing to the person who signed it.
Closing has to wait for things people still hold: an open check, a drawer not yet counted, a person still clocked in. Closing over them issues a report that is wrong on Monday morning.
Three figures are approximations the owner should know about: food cost follows lots oldest first, usage variance is a signal and not a cause, and prime cost is measured against gross sales. A report that presents them as exact is trusted more than it should be, and the owner decides what to cook and whom to rota from it.
Keep the records inspectors and guests ask for
Produces fridge logs with corrective actions, tracing of a recalled lot to the dishes that used it, erasure of personal details with the books kept, and a 90-day export an inspector can read. It adds no new sales or staffing behaviour.
Acceptance criteria
Kitchen staff log readings of a fridge or freezer as whole tenths of a degree Celsius, with the unit and who logged it: 70 is 7.0, -180 is -18.0, and a fractional value is refused. Each unit is either chilled or frozen. A chilled unit is ok at 70 or below and out of limit above it (70 is ok, 71 and 100 are out). A frozen unit is ok at -180 or colder and out of limit above it (-180 is ok, -179 is out, and a freezer reading 40 is out). An out-of-limit reading needs a corrective action (discarded, repaired, moved or other), with who recorded it, and a re-read.
Out-of-limit readings with no action, or whose latest re-read is still out of limit for its unit, are listed as open. A corrective action against an ok reading is refused. On a chilled unit a re-read of 100 records the action and leaves the reading open; a later action with a re-read of 40 closes it. On a frozen unit a re-read of -150 leaves it open and one of -190 closes it.
A reading or an action is never edited or deleted. A mistyped reading is corrected by a new reading.
Architectural guidance
A fridge that sat at 8.0 degrees for a shift with no record of what was done about it is a failed inspection, and possibly food that should have been thrown away. A freezer at 4.0 degrees has thawed what is in it, and one limit for every unit would call that reading fine. A log where a mistyped reading can be deleted can also hide a real one. The inspector asks about the readings that went wrong, not the ones that did not.
Acceptance criteria
A manager recalls a lot. The product lists the dishes whose cooking took grams from that lot, with the portions served, not counting lines voided after firing. It says in plain words that this follows oldest-first use of lots and is an approximation. A lot nothing was taken from lists no dishes.
Recalling the same lot twice is one recall. The grams still in the recalled lot are written off as waste with the reason other and the approver, and later cooking is not taken from the recalled lot. With two lots of one ingredient, cooking across both and a recall of the second, the list shows the dishes that took grams from the second lot.
Architectural guidance
A recall has to be answered the same day. A group that can only say that everything cooked with the ingredient is affected throws away more food than it has to, and one that says nothing serves it. A recalled lot left in stock gets cooked with tomorrow, and the group has to be honest that its trace is an estimate, because the kitchen never tracked which plate got which lot.
Acceptance criteria
A guest's name, phone number and allergy declarations, and the card guarantee token of their bookings, are erased 12 months after the last booking and on request. A guest is the set of bookings sharing a phone number. Reservations, party sizes, times, tables, checks, payments and the no-show fee stay, identified by ID. A staff member's name and contact details are erased 12 months after their last shift and on request; staff identifier, role, shifts, minutes worked, labour cost and tip shares stay.
Erasure on request is a manager's call naming the guest or staff member. It records who asked, when, and the categories erased, never the values. With the simulator's clock moved forward, a guest whose last booking was exactly 12 months ago is erased, and one at 11 months and 29 days or one with a future booking is not. Erasing twice changes nothing.
Afterwards a search of everything the product stores and keeps for the person's name and phone finds nothing, the visit can still be followed, and the daily figures are unchanged.
Architectural guidance
A guest who asks to be forgotten and finds their phone number in a booking history a year later has grounds to complain, and the group cannot say where else it is. Delete the whole booking and the checks, payments and no-show fees no longer add up. The books and the person are different things, and the group needs both answers right at once.
Acceptance criteria
An export for a site covers the last 90 days, with a header and a stated format, in two parts. The fridge part lists readings (unit, unit type, temperature in tenths, status, who logged it, the corrective action with its re-read) and lists any out-of-limit reading with no action. The lot part lists deliveries by lot with the supplier and the supplier's lot code, consumption by lot, and recalls with the dishes they reached.
A reading 90 days and one millisecond old is left out. The same export run twice gives the same output. Records older than 90 days are still stored: counts before and after are equal, because no purge exists. The format description is a deliverable an inspector could read without the product.
Architectural guidance
An inspector asks for a period, and a group that hands over everything, or something slightly different each time, cannot say what it showed. A boundary off by a day gives the inspector a reading that should have been out, or hides one that should have been in. An export that deletes what it leaves out destroys the records the next inspection needs.
Acceptance criteria
A named test, with its command in the README, moves the simulator's clock so that a guest's last booking is exactly 12 months old, and finds the guest erased, while a guest at 11 months and 29 days and a guest with a future booking are not. A search of everything the product stores for the erased guest's name and phone finds nothing, the visit can still be followed, and the daily figures are unchanged. A fridge reading of 71 on a chilled unit and -179 on a frozen unit is listed as open until a corrective action with a re-read in limit closes it. The 90-day export, run twice, gives the same output, leaves out a reading 90 days and one millisecond old, and the stored counts before and after are equal.
Architectural guidance
An erasure that takes the visit's checks or the fridge log with it removes what an inspector may ask for. An erasure that leaves a phone number in a note breaks the guest's request.
Architectural walkthrough
Three kinds of record are asked for by someone outside, at a moment the group does not choose. An inspector can ask for the fridge readings and for which supplier lot went into which dish. Today the answer is a binder, and a binder cannot tell an inspector which readings over the limit for their unit had no corrective action. A group that cannot answer fails the inspection, and one that answers wrongly is worse off.
A supplier recalls a lot. The group has to say which dishes could have used it, down to the portion, while the lot may still be in the walk-in. The kitchen cannot know which lot went into which plate, so the answer follows oldest-first use of lots and is an estimate that the group must say plainly it is.
A guest or a member of staff can ask to be forgotten, and house policy erases personal details 12 months after the last booking or last shift. The group still owes the books: checks, payments, shifts, tip shares and traceability stay, identified by ID. Erase too much and the books no longer add up. Erase too little and a person's name and phone number sit in places nobody remembers.
Operate the group through a failure Friday
Produces a way to follow one guest's visit, records that keep failing set aside without stopping trade, an update shipped to one capability during dinner, deadlines held at a full Friday's volume, and a simulated Friday with every failure at once. It adds no new client features.
Acceptance criteria
An operator gives a visit and one documented command shows everything the product did for it, in the order it happened: the booking, the seating, the order and its courses, kitchen tickets and bumps, voids, the check, the payments and the settlement. Each step says what happened and whether it failed, with the error.
For a booked party of 4 with a limited dish, one line voided before firing, two cards and cash with a tip, and a close, the whole chain shows. A platform order's visit begins when the order arrives. A visit caught up after an outage shows its offline actions in the order they happened, with their later arrival. A visit with a missing step shows the gap as a break; a test makes one step go missing on purpose and the command reports the break there. An unknown visit prints an empty result and no error.
Architectural guidance
A guest phones to say they were charged and never served. Without a way to follow their visit from end to end, the answer takes someone a long read across separate screens, and may be wrong. A chain with a gap in it is the one that matters, and a tool that hides gaps is worse than none.
Acceptance criteria
A record the product cannot process (a menu change, an invoice, a platform order) that keeps failing after repeated attempts is set aside with what failed and when, and the records behind it carry on. You choose how many attempts and document it. A record that fails only because the product was stopped or restarted is not set aside: with the whole product stopped while 20 records were waiting, none is set aside and all 20 are processed after the restart.
An operator lists the set-aside records with their number and the age of the oldest, and retries all of them or one. In the test, a menu change with a value that ordering cannot handle keeps failing and is set aside, while later menu changes still reach ordering and the kitchen display. After the fix, retrying makes the dish sellable. Retrying the same record twice has the effect of one. A retry that now succeeds clears the record, and one that fails again stays.
Architectural guidance
One menu change that cannot be read stops every change behind it if the product keeps trying the same one forever. Throwing it away instead means the dish never appears and nobody knows. A record that fails because the product was down for a minute is not a bad record, and treating it as one loses the 20 good ones that failed with it.
Acceptance criteria
One documented command runs a simulated dinner at one site and, during it, ships a new version of one named capability, then another, then another, for at least three of: booking, ordering, stock, card payments, staff scheduling, online orders and reports. The README says how to ship an update.
During each update no seated party is lost, and no order, payment, ticket or booking a person submitted is lost or doubled. The other capabilities keep serving: a table is booked, an order is placed on another terminal, a ticket is bumped and a platform order is decided inside its window. A dish that sells out is still off sale within 10 seconds, and the dinner's totals equal a run with no update.
The command prints the checks and the totals of both runs. Run it once against a deliberately broken build that drops whatever is in progress when it is updated, and commit that output.
Architectural guidance
A restaurant cannot pick a quiet hour for an update, because the Friday dinner is the hour. An update that drops the order being placed at the moment it ships loses a guest's order, and nobody finds out until the guest asks. An update that stops the whole product to change one part turns a small fix into a lost evening.
Acceptance criteria
One documented command compresses a Friday's volume for the three sites (about 720 covers and about 108 online orders) into one hour of simulated trade, and prints the worst measured time for each deadline: a sold-out dish off sale everywhere within 10 seconds of the sale that took its last portion; a fired course on the right display within 5 seconds; and every platform order decided inside its 3-minute window.
No dish sells more than it has, and no order, payment or ticket is lost or doubled. The figures printed are counts and worst times, so a reviewer sees the worst case and not an average.
Architectural guidance
Deadlines that hold at ten covers fail at 720. An average hides the guest who waited, and a sold-out dish that takes 40 seconds to disappear is sold to several guests in that time. A product tested only at a quiet table works until the first full Friday.
Acceptance criteria
One documented command runs one simulated Friday twice with the same seed, once clean and once with failures: 3 sites, about 720 covers and about 108 online orders. The failure run injects a 90-minute terminal outage during dinner, stock stopped while a terminal needs more portions, a processor that takes the money and gives no answer, a platform order delivered twice, a recalled lot, a void after a fired course, and one update shipped to a capability during dinner. Both runs close the three days and issue three Z reports.
A comparison lists every difference, and each is explained by an injected failure. The allowed differences are the sales of guests turned away while stock was stopped (those dishes show sold out at that seller) and the voided line and its waste. Everything else is equal: no order, payment or ticket is duplicated; every action the terminals recorded exists once; no limited dish sold more portions than it had; each dish was off sale on the platform within 10 seconds of its last portion; the timed-out capture was charged once; the duplicated order made one platform order; the dishes reached by the recalled lot are listed; nothing is left in the set-aside records.
The Z reports of the failure run equal the clean run's, minus the allowed differences, to the cent. Restoring the reports from stored data gives the same figures. Following one guest from the outage shows a complete chain. The results and the comparison are committed. The README gets a reviewer from a fresh clone to a closed day with a Z report in 20 minutes.
Architectural guidance
This is the Friday the client lived through, replayed on purpose. Each failure alone is survivable, and the damage comes from the one nobody tested next to the others. If the comparison shows a difference that nothing explains, the owner cannot tell whether a missing amount was the outage or the product.
Architectural walkthrough
The group fails in combinations. A terminal outage during dinner, a seller running out of portions, a processor that takes money and does not answer, and an update shipped at 20:00 do not arrive one at a time on a Friday. No earlier test ran them together, so none of them has shown how the group behaves when they do.
A record the product cannot process must not hold up the ones behind it. If one menu change carrying a value ordering cannot handle stops every later change, the kitchen cooks from an old menu until somebody notices. A record that fails only because the product was down for a minute is not a bad record, and it has to be processed after the restart, not thrown away.
An update during dinner must not drop the order being placed, the ticket being bumped or the payment being taken. A restaurant with a full dining room cannot wait for a quiet hour to change its software.
A full Friday's volume, about 720 covers and 108 online orders, puts every deadline under pressure at once: a sold-out dish off sale everywhere within 10 seconds, a ticket on the display within 5 seconds, a platform order decided in 3 minutes. The cost of getting it wrong is a Friday on which the owner cannot say what happened to a guest, a stalled kitchen, and an update that loses orders.
Architectural walkthrough
Who may say yes to a scarce thing
Most of the group's data records what happened and can be corrected afterwards, but a few decisions cannot wait for a correction. When two terminals and a delivery app each have a guest in front of them and one portion of lamb is left, someone has to say yes to exactly one of them, and the answer has to come while the cloud is gone.
The old setup let every seller read one shared portion count and subtract one. Two sellers read 1 at the same moment, both subtract, and the last shoulder is sold twice. A guest then waits for a dish nobody can cook, and the server finds out when the kitchen says so. Making every sale wait for a central answer has the opposite cost: a terminal without the connection either stops selling or goes back to guessing.
The group chose its trade. It would turn a guest away before it sold a dish twice, and it still wants every terminal to keep selling what it safely can while cut off. The test of that choice is the dish never selling twice when sellers race, when one of them dies holding portions, and when stock is unreachable.
Two different scarce things
The last portion and the last table each look like scarcity and each fails differently. A table given to two parties seats two groups at one table at 21:00. With booking stopped, nobody can book and the guest rings back, which the group accepts for a table and would not accept for a dish being sold in front of a guest.
Records nobody can edit
Stock in grams follows what happened and may read below zero until someone counts. A void, a comp, a refund, a count and a tip correction each leave the earlier figure in place and name the manager who approved it. When a drawer is short or a void looks odd, the investigation needs records nobody could have edited, and a record edited after the fact leaves the owner with a figure the owner cannot trust and a manager nobody can question.
The day belongs to the business
An order rung at 01:30 on Saturday belongs to Friday. A report grouped by calendar date splits Friday dinner across two days, and the owner reads a quiet Friday and a busy Saturday that never happened. The two nights a year the clocks change make the day 23 or 25 hours long, so a rule that subtracts a fixed number of hours files sales under the wrong day on exactly those nights.
A sale can also arrive after its day was closed, because a terminal syncs on Saturday morning what it rang on Friday. The Z report already printed for Friday cannot change under the manager who signed it, and the owner still needs the late sale counted.
The terminal decides alone
The terminal is the hardest case because it must act on its own authority. It may sell from the portions it was given, take card payments up to 150 EUR each and 1,500 EUR in total per outage, and keep tickets flowing to the kitchen display over the local network. It may not promise anything else. The loss from a terminal that was wrong stays bounded by numbers the group chose in advance: the portions it held and the card money a processor might decline when the backlog arrives.
A backlog that arrives twice, or half-arrives and resumes, must not create a second order. Two terminals that took payment for the same check while cut off must end with one payment and one refund. A dish the chef took off the menu while a terminal was cut off will have been sold anyway, and the kitchen has to be told.
What outsiders do to the product
The card processor can take the money and then fail to answer. A retry that charges again bills one part of a split twice and the guest phones. The delivery platform sends an order twice, loses one, and charges a guest for an order that never reached the group. A supplier's invoice arrives before the delivery it bills. Each of these is routine, and a product that treats them as errors loses money or loses trust on an ordinary evening.
Parts that stop and parts that change
A dinner service does not pause for a repair. With card payments stopped, tables still need booking, orders still need taking and the kitchen still needs its tickets. A change to one capability shipped during service must not drop the order a server is placing at that moment. A Friday with 720 covers and 108 online orders crowds the same deadlines into the same hour: 10 seconds to take a sold-out dish off sale, 5 seconds for a ticket to reach the grill, 3 minutes to accept a platform order.
Where it shows if you cut a corner
A dish that can sell twice fails the concurrent-sales test in Phase 6 and the failure Friday in Phase 14, where stock is stopped while a terminal needs more portions.
A report grouped by calendar date fails the business-day test in Phase 1 and the late-sale checks in Phase 12.
A void or recall that edits a record instead of leaving it fails the kitchen and check test in Phase 5, and later makes the restored reports differ from the live ones in Phase 12.
A processor call retried as a new charge fails the timeout-after-capture test in Phase 8, where one part of a split is charged twice.
A terminal backlog accepted twice fails the 90-minute outage test in Phase 11, and a capability that needs another to be running fails the stopped-capability tests in Phases 4, 9 and 14.
An update that interrupts an order in flight, or a day that misses the 10-second, 5-second or 3-minute deadline at full volume, fails Phase 14.
Related Links
- Annex II of Regulation (EU) No 1169/2011, the 14 allergensthe product knows 14 allergen codes and a dish shows only the union of its ingredients' codes.
- EU Directive 89/108/EEC on quick-frozen foodsa frozen unit is in limit at -18.0 C or lower.
- CNV: working hours, breaks and resta roster needs a 30-minute break on a shift longer than 5 hours 30 minutes.
- KHN: rules on work and rest for adult staffa roster needs at least 11 hours of rest between shifts.
- Twelve: set up tipping on the CCV terminalthe guest chooses the tip on the card terminal as part of the card payment.
- Toast: close out day overviewthe business day ends at 04:00 and a report covers the whole business day, not the calendar day.
- Peakflo: three-way matchingan invoice is matched against the order and the delivery within a 2% price tolerance.
- Belastingdienst: keeping your recordschecks, payments, shifts, fridge logs and lot records stay for 7 years, so no deletion period is built.