System Design Atlas

Property maintenance across a service network

04 / 10Worked example

Interfaces

A replay does not postpone an appointment. What conditions ensure the result?

The response may be lost.

Starting point Run peak-load and single-worker contention tests separately.

Assumptions for the example case

Fictional repair of a dripping faucet in an apartment. The order contains a fixed scope of work and a confirmed access appointment. All quantities, thresholds and operational objectives of this design are illustrative assumptions.

Appointment and acceptance contracts

Appointment and acceptance as separate commands

Appointment commandT-44 · F-44 · interval
Termincommand → Terminbestandatomic testing
Appointment data storeHistorical response

An appointment replay returns T-44; a changed start returns a conflict; acceptance uses its own key.

Appointment confirmation and acceptance as separate commands with their own keys.

Proposed domain contracts

  1. POST/auftraege/A-44/termine

    Allocate an appointment definitively.

    Input
    commandKey, technician=F-44, start, end, travelBufferMinutes=30, accessConfirmed, expectedVersion
    Result
    Confirmed appointment T-44 or occupancy conflict.
    Retry behaviour
    An identical retry returns T-44; a changed time with the same key produces a conflict.
  2. POST/auftraege/A-44/abnahmen

    Review completed work.

    Input
    acceptanceKey, workReportHash, outcome=accepted|rework, reason, expectedVersion
    Result
    Accepted or remedial work required, with a reason.
    Retry behaviour
    The same evidence takes effect once; a new report requires a new review.

A replay does not reschedule an appointment.

A replay does not reschedule an appointment.

The key binds the time and technician.

The response may be lost.

An identical retry reads the existing appointment. A changed retry produces a conflict; rescheduling checks availability again.

Alternative considered
Changing the time under the same key conceals a rescheduling operation.
Trade-off
Rebooking needs its own command.
Reassess
Complex recurring appointments need a recurrence contract.

Try it yourself

Compare identical and changed start.

A hint for your attempt

The response may be lost.

Compare with a possible solution
Identical
Existing appointment will be read.
Changed
Conflict; rebooking rechecks availability.

Apply to your project

What is the equivalent of “A replay does not postpone an appointment.” in your own project?

Step 5: Remedial work remains open. What conditions ensure the result?