System Design Atlas

Shift planning with qualifications and time tracking

05 / 10Worked example

Data and states

Cancellation does not erase work performed. Which conditions ensure a valid result?

Work may have been performed during a shift that was cancelled.

Starting point Device and event identifiers form the deduplication key.

Assumptions for the example case

A fictional maintenance operation with a defined qualification for each shift. The example requires 11 hours of rest between planned shifts; this is an exercise assumption and does not replace an employment-law review. All quantities, thresholds and operational objectives are illustrative assumptions.

Separate planned and actual work

Planned and actual work as separate state machines

Shift plan

ProposedS-47
Vorgeschlagen → BestätigtEligibility satisfied
ConfirmedInterval bound
Bestätigt → StorniertBefore start
CancelledPlan terminal
Bestätigt → Abgerechnet zur ÜbergabeActual work fully reviewed
Ready for handoverPlan completion

Actual time

Time entry pendingB-47 permanently stored
Zeitbuchung offen → In KlärungConflicting device data or deviation from the plan
Under reviewThe original is preserved
In Klärung → GeprüftCorrection with original reference
VerifiedTime reviewer confirms

Cancelling a plan preserves actual work; the time entry is retained and deviations go for review.

Plan: Proposed → Confirmed → Cancelled / Ready for handover. Time entry: Open → Under review → Verified. Cancellation preserves actual work.

State transitions and completion

Starting pointCondition and effectSubsequent state
ProposedEligibility and timing rules satisfiedConfirmed
ProposedRule test failsRejected
ConfirmedCancellation authorised before the shift startsCancelled
ConfirmedShift time ended; actual times fully checkedReady for handover
Time entry pendingContradiction between devicesUnder review
Under reviewA time reviewer confirms a correction linked to the originalVerified

Proposed

Condition and effect
Eligibility and timing rules satisfied
Subsequent state
Confirmed

Proposed

Condition and effect
Rule test fails
Subsequent state
Rejected

Confirmed

Condition and effect
Cancellation authorised before the shift starts
Subsequent state
Cancelled

Confirmed

Condition and effect
Shift time ended; actual times fully checked
Subsequent state
Ready for handover

Time entry pending

Condition and effect
Contradiction between devices
Subsequent state
Under review

Under review

Condition and effect
A time reviewer confirms a correction linked to the original
Subsequent state
Verified

Cancellation does not erase work performed.

Cancellation does not erase work performed.

The time account remains independent.

Work may have been performed during a shift that was cancelled.

Confirmed→Cancelled preserves history. Late booking will be accepted and verified; it will not be discarded by cancellation.

Alternative considered
Deleting with the plan destroys proof.
Trade-off
Some cases still require review.
Reassess
Frequent deviations require process verification.

Try it yourself

Draw cancellation and subsequent actual booking.

A hint for your attempt

Work may have been performed during a shift that was cancelled.

Compare with a possible solution
Plan
Confirmed→Cancelled preserves history.
Actual work
Late booking will be accepted and verified; it will not be discarded by cancellation.

Apply to your project

How does this principle apply in your own project: Cancellation does not erase work performed.

Step 6: One datastore supports two domain modules. Which conditions ensure a valid result?