System Design Atlas

Shift planning with qualifications and time tracking

04 / 10Worked example

Interfaces

Offline identifiers preserve the time entry. Which conditions ensure a valid result?

Response loss triggers resending.

Starting point UTC instants make the time difference unambiguous.

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.

Offline Event Contract

Offline Event Contract

Offline appdeviceId + eventId
Offline-App → Planungs-APIB-47 with occurredAt
Scheduling APIauthenticated acceptance
Planungs-API → Ereignis-InboxCommit before reply
Event inboxidentical: proof · changed: conflict
Ereignis-Inbox → Korrektur B-47-K1own key + original reference
Correction B-47-K1Reason and authorised time reviewer

Device and event identifiers determine retry identity; a correction is a separate operation referencing B-47.

Device identifier + event identifier: Deduplicate identical retries, reject changed payloads and give corrections their own reference.

Proposed domain contracts

  1. POST/schichten/S-47/bestaetigungen

    Confirm the person's shift assignment.

    Input
    commandKey, person=P-47, startUtc, endUtc, qualification=Q-47, qualificationVersion, expectedPlanVersion
    Result
    Confirmed shift or conflict/lack of suitability.
    Retry behaviour
    Identical same outcome; other person under same key conflict.
  2. POST/zeitbuchungen

    Accept an offline time entry.

    Input
    deviceId, eventId=B-47, person, occurredAt, kind=start|end, deviceSequence
    Result
    Durably accepted, associated or awaiting review.
    Retry behaviour
    Identical event once; altered timestamp with the same identifier conflict.

Offline identifiers preserve the time entry.

Offline identifiers preserve the time entry.

Device and event identifiers form the deduplication key.

Response loss triggers resending.

Read the saved result. Conflict; reasoned correction references B-47 separately.

Alternative considered
Timestamp alone collides with simultaneous events.
Trade-off
Devices shall store stable identifiers.
Reassess
Replacing a device requires a transfer contract.

Try it yourself

Check identical and modified timestamps under B-47.

A hint for your attempt

Response loss triggers resending.

Compare with a possible solution
Identical
Read the saved result.
Changed
Conflict; reasoned correction references B-47 separately.

Apply to your project

How does this principle apply in your own project: Offline identifiers preserve the time entry.

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