System Design Atlas

Restaurant orders between service and kitchen

05 / 10Worked example

Authoritative data and states

What conditions arise during the race between the start of preparation and cancellation?

The interfaces require an authoritative state. Each portion has exactly one current preparation state and at most one handover record. Cancellation after preparation starts preserves the work already underway. Local entry becomes a kitchen order only after kitchen acceptance. The table separates current states from the records explaining how they arose.

Starting point Persist and compare K-131 and its content.

Assumptions for the example case

Our fictional example design covers one restaurant with table service, individual ordered portions, explicit kitchen acceptance, cancellation before preparation starts and recorded handover. Quantities and quality goals are illustrative test assumptions. Cash-register regulations, payment processing, automated allergen safety and delivery logistics are outside the scope.

Data relationships and permitted transitions

A ticket groups portions; each portion has independent transitions

Table order T-131Service input
Kitchen ticket K-131Accepted content
P-131 · SoupIndependent state
P-132 · Main courseIndependent state
Handover recordNot more than one
angenommen → in_zubereitung or storniertin_zubereitung → fertig or klärungfertig → ausgegeben

T-131 and K-131 link the portions; starting, cancelling, completing and handing over remain traceable per portion.

Both teams act concurrently. Serialise both actions against the same portion version. Either order of execution has an explicit outcome.

Entities and relationships

EntityAuthoritative dataResponsibility
Table order T-131Table, portions, versionThe new portion remains its own identity.
Portion P-131 and P-132Dish, instructions and preparation stateOne handover per portion.
Kitchen ticket K-131Accepted items and their orderAcceptance is separate from local input.
Amendment documentPosition, old status, new content, decisionChanges after preparation starts require kitchen involvement.
Handover recordPortion, service person, timeProof of actual handover.

Table order T-131

Authoritative data
Table, portions, version
Responsibility
The new portion remains its own identity.

Portion P-131 and P-132

Authoritative data
Dish, instructions and preparation state
Responsibility
One handover per portion.

Kitchen ticket K-131

Authoritative data
Accepted items and their order
Responsibility
Acceptance is separate from local input.

Amendment document

Authoritative data
Position, old status, new content, decision
Responsibility
Changes after preparation starts require kitchen involvement.

Handover record

Authoritative data
Portion, service person, time
Responsibility
Proof of actual handover.

Permitted state transitions

Starting pointTargetCondition
erfasstangenommenThe kitchen confirms the concrete content.
angenommenin_zubereitungKitchen team starts this portion.
angenommenstorniertCancellation wins before preparation starts.
in_zubereitungfertigKitchen team confirms completion.
in_zubereitungklärungCancellation request or quality problem is clarified manually.
fertigausgegebenService confirms handover.
ausgegeben or storniertterminalNew portion or replacement gets its own identity.

erfasst

Target
angenommen
Condition
The kitchen confirms the concrete content.

angenommen

Target
in_zubereitung
Condition
Kitchen team starts this portion.

angenommen

Target
storniert
Condition
Cancellation wins before preparation starts.

in_zubereitung

Target
fertig
Condition
Kitchen team confirms completion.

in_zubereitung

Target
klärung
Condition
Cancellation request or quality problem is clarified manually.

fertig

Target
ausgegeben
Condition
Service confirms handover.

ausgegeben or storniert

Target
terminal
Condition
New portion or replacement gets its own identity.

Serialise preparation starts and cancellations

Serialise preparation starts and cancellations

Serialise both actions against the same portion version.

Both teams act simultaneously.

Either order of execution has an explicit outcome.

Alternative considered
Cancellation as deletion conceals started work.
Trade-off
Late cancellations require investigation.
Reassess
The kitchen defines points where preparation can be stopped automatically.

Terms in this step

Serialise preparation starts and cancellations
Either order of execution has an explicit outcome.

Try it yourself

Run start and cancellation of P-131 in both orders.

A hint for your attempt

Use the specific entities and conditions from this step. The two solution parts distinguish the decision from its evidenced outcome.

Compare with a possible solution
First part of the solution
Cancellation first: storniert; a later start receives a conflict.
Second part of the solution
Start first: in_zubereitung; the cancellation request requires investigation. Work already started remains visible.

Apply to your project

Which corresponding assumption in your project would you check first? Consider this trigger: The kitchen defines points where preparation can be stopped automatically.

Step 6 keeps the local processing path short.