Skip to content

Build an Offline Job System for a Plumbing and Heating Firm

Davor Minchorov•Intermediate•6 to 7 weekends•November 26, 2026

A plumbing and heating firm saves each job as one record, so a phone that was offline for hours overwrites what the office decided in the meantime. You will build the job system from the first call through booking, stock and the technicians' phones to the invoice, and prove it on a simulated working day.

The brief

The client

I run a plumbing and heating firm with nine technicians and about 35 jobs a day, mostly for homeowners and a few letting agents. Our office admin and I dispatch from the same screen, and every technician has a phone with our job app, which saves the whole job record whenever it finds signal. Last month the office corrected a house number from 14 to 41 at 09:30 and added the gate code to the access notes. The technician spent the afternoon inside a farmhouse with no signal, wrote up a weeping pressure relief valve on the hot water cylinder in his notes, and synced at 17:45. His old copy replaced the whole record, so the address went back to 14, the gate code vanished, and the follow-up visit was booked to the wrong house. I need the office and the phones to be able to disagree for hours, with every disagreement visible and settled by a rule that says who owns each part of a job.

The problem

The app stores each job as one record, and the office screen, each technician's phone and the accounts screen all overwrite it. A phone that has been offline holds a copy of the job as it was, and when it syncs, that copy replaces whatever the office decided in the meantime. The record cannot tell a decision from a stale copy.

Two other things follow from the same habit. Van stock is a spreadsheet each technician updates in the evening, so nobody knows which van holds a circulation pump, and two jobs can be promised the last one. Invoices come from a button on the accounts screen and not from a job finishing, so a job cancelled in the office and finished on a phone can be billed, and a finished job can be missed. The cost is a visit to the wrong house, a letting agent disputing an invoice for a job the agent had withdrawn, and an office admin who rebuilds the day by phone every evening.

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

  • Take a job request from a web form or the phone desk with an address, the kind of problem and a description, and put an emergency ahead of routine work by rules the client can read.
  • Open exactly one job for each triaged request, keep a history the office can read of everything that happened to the job, and refuse a status move that the job's states do not allow.
  • Book a job to a technician who has the skill for its trade, is on shift and is free, and never hold two overlapping bookings for one technician, even when two dispatchers book at the same moment.
  • Track parts in the warehouse and in every van, and reserve a part for a job without promising the same unit twice.
  • Show each technician the day's jobs on a phone with no signal, and accept the changes made offline when signal returns, so that receiving the same change twice, late or out of order, gives the same result.
  • Merge offline changes by a rule per field: notes, time on site, parts used and photos are kept; status follows the job's states; address, access notes and booked time belong to the office. No change is silently lost, and every refusal is a conflict the office can see.
  • Record a part a technician used offline even when stock says the van had none, and tell the stores person about the shortfall.
  • Invoice a completed job exactly once, record payments that arrive twice, late or out of order once, and let the office settle a conflicting visit by charging or waiving a flat fee.
  • Erase a customer's name, phone and email on request, and keep invoices, payments and the work history.
  • Show with one command that no two bookings overlap, no job status disagrees with its history, no invoice exists for a cancelled job without a charged fee, and every completed job has exactly one invoice.

Deliverables

  • Your repository starts the whole product with one command, together with the simulated phones and the payment provider stand-in, with seed data for nine technicians, nine vans, a warehouse and the price list.
  • A README that takes a reviewer from a fresh clone to a simulated working day's report in 15 minutes, and lists the command for each test.
  • A table that gives every job field an owner and says what happens when two parties change it without seeing each other.
  • A test suite for every Phase. The tests that send competing requests run them at the same moment and are shown able to fail.
  • A way to run the firm's day faster than real time and to cause the outside failures this brief names: a phone uploading the same changes twice, out of order or 8 hours late with a clock up to 15 minutes wrong; the payment provider sending a message twice, late, out of order or without the proof that it sent it; and the process being killed in the middle of its work.
  • The result of the Phase 4 test and the report of the final simulated day, both committed to your repository.
  • A short operations note: how to check that every job's status matches its history, how to read and settle a conflict, and how to read a stock shortfall.

Out of scope

  • Quotes, quote acceptance and variations. The firm bills a call-out charge, an hourly rate and parts at list price, so there is nothing to accept.
  • Gas safety certificates and compliance deadlines. They need the regulated-job rules that the advanced brief builds, and they repeat the status-move rule from Phase 2.
  • Customer messages and arrival-window texts. Sending one message per reshuffle needs coalescing across a day of changes, which is the advanced brief's subject.
  • Route optimisation. The vehicle routing problem is a research field of its own, and skill, shift and overlap checks are enough here.
  • A native technician app. A simulated phone stands in for the real ones, because the rule for each field is the subject.
  • Photo files. A photo is a reference string on the job, and storage and upload are not the subject.
  • Card handling. Payment arrives as messages from a payment provider stand-in you build, so card data never enters the product.
  • Live van tracking. It adds a personal-data problem and no consistency problem.
  • Supplier purchase orders, accounting export and a customer portal with accounts. Each needs rules or integrations this brief does not fix, and replenishing a van is a recorded transfer of stock.
  • Tax lines. Invoices show one total in euro cents. A real Dutch invoice also shows the VAT separately, which this brief leaves out to keep the money rules to one.
  • Deleting invoices and payments once their 7 years have passed. The product only keeps them, and the brief gives no legal advice.

Architectural constraints

  • Money is an integer number of euro cents, and an amount is exact to the cent.
  • Times shown to staff and technicians are in Europe/Amsterdam, and a booking made for 09:00 still reads 09:00 after the clocks change.
  • A technician never holds two overlapping bookings, and a job never holds two active bookings. A booking that starts exactly where another ends is accepted.
  • The office owns a job's trade, urgency, description, site address, access notes, booked time and estimated minutes. A phone's change to any of them is refused, and the office can see that it was.
  • A technician's notes, time on site, parts used and photos are never lost, whichever phone sent them and in whatever order they arrive. The phone's clock decides the order of nothing.
  • A job is open, completed or cancelled. The technician completes an open job, the office cancels an open job, and nothing leaves completed or cancelled.
  • The same part is never promised to two jobs, and a reservation never takes available stock below zero. A part a technician reports used is recorded even when stock disagrees.
  • A change sent by a phone takes effect once, however many times it arrives. A message from the payment provider takes effect once, however many times it arrives, and a message the provider did not send changes nothing.
  • A completed job is invoiced exactly once. A cancelled job is never invoiced, except for the flat visit fee when the office decides to charge it. An issued invoice does not change when a price or a later time log changes.
  • No card number is ever stored.
  • A customer's name, phone and email are erased on request, while invoices, payments and the work history stay, identified by the customer's ID. Dutch law requires the client to keep its business records, invoices and payments included, for 7 years (Belastingdienst), so erasure never removes them.
  • A customer's phone number appears only on the technician's phone for the day's visits. The site address and access notes may be copied onto the job, and the billing name and address onto an issued invoice.
  • When the process dies at any moment, nothing is lost and nothing is doubled: a triaged request ends with one job, a completed job with one invoice, and a payment message with one payment.

Prerequisites

You have built one application with a database, in any language and framework. You can start a process on your machine and send several requests to it at the same moment. You do not need distributed systems experience, and you do not need to have built Build a Parcel Delivery Network. You do not need to know how a plumbing and heating firm runs its jobs; the first Phase explains the business and the words the brief uses. If the domain is new to you, Build a Diary and Job Sheet for a One-Van Electrician covers the same words at a smaller scale. Having once lost an edit because two screens saved the same record will make most of this brief familiar.

Create a free accountSign in

Free to start. An account is what keeps track of the checkpoints you finish.

Phase 1

Work out the firm's rules by hand

Produces a replay of the day a visit went to the wrong house, a worked example of a job from the first call to the final payment with the client's numbers, and a table that says who decides each part of a job. Builds nothing yet: the product comes in the next Phase.

Research

Research

Architectural walkthrough

How a plumbing and heating firm runs its jobs

The client is a plumbing and heating firm with nine technicians, nine vans and a warehouse. About 35 jobs a day come in, mostly from homeowners and a few from letting agents, by a web form or by phone. The office admin and the owner dispatch from one screen, and every technician has a phone with the job app.

A request names an address, the kind of problem and a description. Each problem type has a trade and a time estimate: a burst pipe is plumbing for 90 minutes, a no-heating call is heating for 90. A burst pipe is an emergency, and so is a no-heating call from a home with a vulnerable resident. Everything else is routine. The office books the job to a technician with the skill for the trade, who is on shift and free. A booking lasts the estimated time plus 25 minutes of travel.

A technician sees the day's jobs on the phone and often works where there is no signal. The technician writes notes, logs time on site, records parts used from the van and adds photos. The phone sends these changes when signal returns. The office, meanwhile, may have changed the address or the access notes. Van and warehouse stock are tracked by part. When a job is done, the firm invoices a call-out charge of 7000 cents, labour at 1500 cents for each started 15-minute block, and parts at list price.

The words this brief uses:

  • Trade: the kind of work, plumbing or heating, which a technician needs the skill for.

  • Triage: deciding a request's trade, urgency and time estimate from the problem type.

  • Emergency and routine: the two urgencies. An emergency goes ahead of routine work.

  • Shift: the hours a technician works, with a break.

  • Booking: the slot a technician is given for a job, including travel.

  • Van stock: the parts a van carries, tracked apart from the warehouse.

  • Reservation: a part set aside for a job so it is not promised twice.

  • Access notes: how to get into the property, such as a gate code.

  • Call-out charge: the fixed charge for a visit.

  • Conflict: a change from a phone that the office's version contradicts, which the office has to see and settle.

Why the rules are worked out first

This Phase has no software. You work out how the firm runs, with the client's numbers, before anything can be wrong in code. Getting a rule wrong here costs a rewrite later, because every part of the product depends on the answers.

The failure to avoid is the one that sent the follow-up visit to the wrong house. The old app gave every field the same rule: whatever was saved last stood. A rule invented inside a screen during a deadline becomes the same rule again, because it is the shortest thing that makes the screen stop complaining.

A second failure is small arithmetic nobody wrote down. Working three jobs by hand, with numbers, finds every one of them while it still costs a paragraph.

Phase 2

Open and track jobs

Produces triage of a request, a job opened for every triaged request, and a history for each job whose status only moves by the legal moves. Leaves booking, stock and phones for later: nothing here knows a technician exists.

Implementation

Implementation

Testing

Architectural walkthrough

The failure this Phase must survive is a job that cannot explain itself. The old app updated one record in place, so the 14:10 cancellation and the 14:30 completion could not both exist, and nobody could tell which had come first. A status with no history behind it cannot be defended to a letting agent who disputes an invoice. So a job keeps everything that happened to it, in the order the firm applied it. A phone's clock is shown beside each entry and decides nothing, because a phone can be wrong by 15 minutes and silent for hours.

A process that dies between saving a request and opening its job, or between a move and its history entry, is the other failure, and urgency decides who is sent first.

Phase 3

Never promise a slot or a part twice

Produces bookings that cannot overlap and stock that cannot be promised twice, each proven by a test that sends competing requests at the same moment. Leaves phones, parts used offline and invoices for later: stock only changes through receipts, transfers, adjustments and reservations.

Implementation

Testing

Implementation

Testing

Architectural walkthrough

The failure this Phase must survive is two people being told yes to the same thing. The office admin and the owner both dispatch from one screen. If each request first asks whether 09:00 is free for a technician and then books it, both can ask before either writes, both hear yes, and both book. The technician has two jobs at 09:00 and the second customer waits at a door. The same shape promises the last circulation pump to two jobs, and a technician finds out in a customer's kitchen that the van does not have it.

Booking one job twice, a test that cannot fail, and a booking or reservation still held after its job was cancelled are the same problem seen from other sides.

Phase 4

Sync the technician's phone

Produces what a technician sees on a phone with no signal, changes accepted once and in the phone's own order, a rule for every field, conflicts the office can read, and parts used offline recorded in stock. Leaves invoices and payments for later, so a completed job is not yet billed.

Implementation

Implementation

Implementation

Implementation

Implementation

Testing

Architectural walkthrough

The failure this Phase must survive is the one in the client's story: a phone that was offline since 08:00 replaces a house number the office corrected at 09:30, and nothing says which copy was newer. A phone never sends a whole job here. It sends what the technician did, and the firm decides what each change means by the table you wrote in Phase 1.

Phones send the same changes twice, out of order and hours late with a wrong clock. A change refused without anyone seeing it is a lost edit, and a part used offline is a fact stock has to record.

Phase 5

Bill the work and prove the day

Produces one invoice per completed job, payments recorded once from a provider stand-in, a settlement for conflicting visits, customer erasure, and a command that checks the firm's rules after a simulated working day. Leaves tax and refunds out.

Implementation

Implementation

Implementation

Implementation

Testing

Architectural walkthrough

The failure this Phase must survive is money that disagrees with facts. A job cancelled in the office and finished on a phone must not be billed. A finished job must not be missed, and must not be billed twice when a retry follows a crash. An invoice already issued must not change because a price list changed or a late time log arrived, since the customer holds the old one.

Payment messages that repeat or arrive out of order, a visit fee decided by a person, and an erasure that has to reach every copy while invoices and payments stay for the 7 years Dutch law requires come next. The last Checkpoint runs the whole day with every failure at once.

Architectural walkthrough

A phone's old copy replaces a decision

The old app stored each job as one record and let the office screen, every phone and the accounts screen overwrite it. Each failure in the client's story follows from that. A phone that had been offline for hours held a copy of the job as it was, and when it synced, the copy replaced what the office had decided in the meantime. Nothing in the record said which copy was newer, so the replacement was silent. That failure, a stale copy replacing a decision, happens in any app that lets a device save a whole record after being offline.

One rule does not fit every field

Letting whoever saved last decide is the shortest rule to write, and it is wrong for most of a job. A technician's notes, minutes and parts only grow, so the loser of the race loses work: a weeping valve written up in a farmhouse, an hour of labour that cannot be billed. The address, the access notes and the booked time belong to the office, so a phone's offline edit of them sends the next visit to the wrong house. The status has a short list of legal moves, and a phone that finishes a job the office has cancelled breaks it. Each field costs the firm something different when it loses, which is why the first Phase writes down who decides what before anything is built.

The cancellation at 14:10, traced

A letting agent withdraws a job on a rented farmhouse because the tenant has moved out. The office cancels it at 14:10. The technician is inside the farmhouse with no signal, finishes the job at 14:30 after 40 minutes on site and one thermostatic radiator valve, and the phone syncs at 17:45.

The notes, the 40 minutes and the valve are things that happened, and the firm needs them. The completion contradicts a decision the office already made. The valve still leaves the van's stock, because a part in a wall is a fact whatever the paperwork says. No invoice may be built for a cancelled job. The visit did happen, so a person in the office decides whether to charge the flat visit fee, and the decision has to be visible later. The order of the decisions is the order in which the firm received them: cancel, then complete. Had the completion arrived first, it would have been accepted and the cancellation refused. A product that cannot say which of those two happened cannot answer the letting agent.

Two people asking for the same thing at the same moment

The office admin and the owner dispatch from one screen. If both book 09:00 for the same technician within the same second, a product that checks first and writes afterwards says yes to both, and the technician has two jobs at 09:00. He finds out when he arrives at one house and the next customer rings to ask where he is. The same shape promises the last circulation pump to two jobs, and two technicians drive off to jobs where only one of them has the part.

The same message twice, late, or in the wrong order

A phone that never heard the first answer sends its changes again. A phone on a bad connection retries one group of changes while a later group gets through. A clock on a phone is wrong by up to 15 minutes, and its upload arrives hours late. The payment provider resends a message when it hears nothing, and a failure it reports can arrive after the success that came later. If the product acts on every copy, a part leaves the van twice, a payment is recorded twice, and a paid invoice goes back to unpaid. If it orders by arrival or by the phone's clock, a technician's second change lands before his first.

The process that dies in the middle

A process can die between saving something and doing what should follow from it. A request is saved and the job never opens: the customer was told it is booked in, and nobody finds out until the customer rings again. A job is completed and no invoice appears: revenue nobody notices is missing. The opposite failure is a retry that does the follow-up twice, and the customer is invoiced twice or two technicians are sent to one boiler. Both are invisible in a test that never kills anything.

What it costs

Conflicts are real records that a person has to resolve. The phone can show a state the office has already overruled until it syncs again. Every field needs a written rule before it has code, and every refusal needs a place where someone reads it. The firm accepted those costs because a visible disagreement is cheaper than the visit to the wrong house.

Where it shows if you cut a corner

If two dispatchers can both be told yes to one slot, the Phase 3 tests find two bookings in it. If the latest edit simply replaces a field, the Phase 4 test ends with a different address from the one the office set. If a job is invoiced from a button and not from the completed job, the simulated day shows an invoice for a cancelled job. If a process dies between completing a job and billing it, the simulated day shows a completed job with no invoice. Run each of those in your own build before you call a Phase done, and read what the product tells the office.