Skip to content

Build a Diary and Job Sheet for a One-Van Electrician

Davor Minchorov•Beginner•1 to 2 weekends•November 26, 2026

A self-employed electrician keeps her diary on paper and her prices in her head, and has booked two customers into the same hour. You will build the small diary and job sheet that refuses overlapping visits, adds up each job, and bills a finished job exactly once, in whatever language and shape you choose.

The brief

The client

I am an electrician. I work alone from a van, doing about five visits a day for homeowners and small shops: sockets, fuse boards, the odd rewire of one room.

My diary is a paper book and my prices live in my head. On a Thursday I wrote two customers into the 10:00 slot because one phoned while I was on a ladder, and I found out when both of them were standing on the doorstep at ten.

I also found a finished job I had never invoiced, and only because the customer asked for a receipt. I want one place that tells me what my day looks like, what each job costs, and which finished jobs still need a bill.

The problem

She writes visits in a paper diary and prices jobs from memory, so a phone call taken at the wrong moment books two customers into the same hour. Each double booking costs her a customer's trust and a rushed afternoon. A finished job leaves no trace that says "not billed yet", so some work is done and never charged, which is money for work she already did.

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

  • Record a customer and a job request for them, and list the jobs that are not yet booked.
  • Book a visit for a job at a start time and a length in minutes, and refuse a visit that overlaps another active visit or falls outside working hours. A refused visit saves nothing.
  • Show one day as a list of visits in time order, with the free gaps between them inside working hours.
  • Cancel a visit so its time is free again and the job goes back to being a request. Cancel a job so it leaves the diary for good, and cancel its visit with it.
  • Add job sheet lines to a job and show the job's total, worked out from the lines.
  • Mark a booked job as done, and list the done jobs that still have no invoice.
  • Bill a done job: it gets the next invoice number and its lines can no longer change. Billing the same job again returns the same number and creates nothing new. List the billed jobs with their invoice numbers.

Deliverables

  • A program you can run on your own machine, in the language and shape you chose (a command-line tool, a web page, or an API that other programs call by sending requests), with a README that gets a reviewer from a fresh copy to a billed job in 10 minutes.
  • The written diary and billing rules from the first Phase, kept in your repository.
  • A test file for the diary, code that drives the program and checks its answers against what you expect, that covers the edges named in the second Phase.
  • The written expected numbers and the final report for one full working week, saved in the README.

Out of scope

  • Two people booking the same slot at the same moment. I take one call at a time; simultaneous bookers are a later problem for a firm with a dispatcher.
  • Several technicians, skills and territories. One electrician keeps the diary to one calendar.
  • The phone working without signal, and merging edits made offline. Everything here runs online.
  • Stock in the van, parts reservations and suppliers. A part is a line with a price on the job sheet and nothing more.
  • Quotes the customer accepts, variations on site, refunds and disputes. A job is priced from the lines I type.
  • Taking payment and chasing it. Billing ends at an invoice number.
  • Tax, VAT, gas work and inspection certificates. These differ by country and regulation, and one flat total in cents keeps the maths checkable.
  • Texting or emailing the customer. Show the arrival time on screen or in the output.
  • Travel time between visits and routing. Visits are separated by what I write, not by a map.
  • Accounts and logins. One electrician uses the tool, so it has no sign-in. Do not put it on the internet, because anyone who can reach it can read and change every customer and invoice.

Architectural constraints

  • Money is a whole number of cents, and every price and total is shown that way.
  • A visit start is a date and a time of day in the electrician's one place, which is local time in Europe/Amsterdam. A visit at 10:00 on one day is a different visit from one at 10:00 on another day.
  • Two visits where one ends at the minute the next one starts do not overlap.
  • A job moves forward only: requested, booked, done, invoiced. A cancelled job stays cancelled, and any other change is refused.
  • A refused action changes nothing. A booking never leaves a visit without a booked job, or a booked job without its visit.
  • You choose the language, the framework and the shape. Everything this brief asks for is stated as what a person does and what they see or get back.

Prerequisites

You can write a small program in a language of your choice and you have saved data to a database or a file once. You do not need to know any framework, and you do not need to have written an automated test. You do not need to know how a one-van electrician runs her diary and bills her jobs; the first Phase explains the business and the words the brief uses.

Create a free accountSign in

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

Phase 1

Know the jobs

Produces the written diary and billing rules, a program that stores customers and jobs, and job sheet lines with a total. No diary yet.

Research

Implementation

Implementation

Architectural walkthrough

How a one-van electrician runs her day

A self-employed electrician works alone from a van. She does about five visits a day for homeowners and small shops: sockets, fuse boards, now and then the rewire of one room. Customers phone to ask for work, often while she is on a ladder, and she has to fit each one into her day on the spot.

A piece of work starts as a request from a customer. She books it as a visit at a start time for a number of minutes, does the work, and then bills it. The bill is built from the lines on the job sheet, which hold what she charged for, parts included, each with a price. After a billed job, the invoice number is what she and her customer both refer to, and her accountant sees the numbers too.

The words this brief uses:

  • Job: one piece of work for one customer. It moves from requested to booked, done and invoiced, and a cancelled job stays cancelled.

  • Visit: the time she is at the customer's door, from a start time for a length in minutes.

  • Working hours: the hours of the day she takes visits in.

  • Job sheet: the list of lines that make up the price of one job.

  • Job total: the sum of the lines on a job sheet, in cents.

  • Invoice number: the number a billed job gets, in sequence, used once.

Why the rules are written down first

The electrician's mistakes came from rules that lived in her head. A rule nobody wrote down gets applied differently each time it comes up, so the diary and the job sheet she ends up with disagree with the way she actually works. Touching visits are the case to settle early, because a one-minute difference decides whether a customer is turned away.

The second problem is the price of a job. A job sheet whose total disagrees with its lines means she quotes one figure and bills another. Amounts that are a cent out show up on an invoice, and a customer who finds one stops trusting the rest. Nothing in this Phase is hard to write, and each shortcut here shows up as a wrong number in the last Phase.

Phase 2

Fill the diary

Produces visits that book a job into the diary, a refusal when a visit does not fit, a day view with its free time, cancellation that frees time, and a test file that pins the edges. No billing yet.

Implementation

Implementation

Implementation

Implementation

Testing

Architectural walkthrough

A visit that ends at 10:00 and one that starts at 10:00 do not clash. A first version that refuses them turns away a booking the electrician would happily take, and one that misses a visit sitting inside another sends two customers to the same door. The Thursday double booking was exactly that failure, done by memory.

The day view and a booking that is only half recorded are the other two problems. Each leaves the diary and the job list telling different stories.

Phase 3

Finish and bill

Produces jobs marked done, a list of work not yet billed, one invoice number per job, and a full working week run that proves the whole. No payments.

Implementation

Implementation

Testing

Architectural walkthrough

A job must be billed once, only when it is done, with the next number in a sequence that has no repeats and no gaps.

The final Checkpoint adds a check you can run without reading the code: write the expected numbers first, then compare them with what the program prints.

Architectural walkthrough

One person cannot be in two places

The whole project turns on one rule: a visit that overlaps another visit, or falls outside working hours, is refused whole. If she has a visit from 10:00 to 11:30 and a customer asks for 11:00 to 12:00, the answer is no and nothing is saved. A visit from 11:30 to 12:30 is fine, because the first one has ended. Cancelling a visit gives its time back.

The Thursday double booking was this check, done by memory. Your program does it the same way every time, which is the only reason to build it.

Why a diary drifts

A diary that shows free time the visits do not support is the Thursday mistake again, now with a program to blame. It tends to appear after a cancellation, or when visits were entered out of time order, so those are the cases to try first. A job total or a list of unbilled work that disagrees with the jobs and lines behind it does the same damage: she quotes one price and bills another, or finished work drops out of sight and goes unpaid.

The overlap check has its own failures. A check that looks only at the hour of the day passes on Tuesday and fails on Wednesday. A check that treats a visit ending at 11:30 and one starting at 11:30 as a clash refuses a booking she would happily take. Try every rule with real dates, and with visits that touch.

Billing has its own failures

A cancelled job that can still be marked done and billed charges a customer for work that never happened. A repeated invoice number, or a gap in the numbers, is what her customers and her accountant notice first. A double tap or a repeated command can ask a customer to pay twice. A bill refused because the job is not done must not use up a number, and stopping the program partway through billing must not lose a number or hand it out twice. Check each of these in your own build, then restart the program and check them again.

What you chose not to build

You left out two bookers at the same moment, several electricians and a phone that works without signal. Those are where a diary stops being simple. The next project up from this one is Build an Offline Job System for a Plumbing and Heating Firm, which works with more than one person and more than one trade.

Where it shows if you cut a corner

Four symptoms show a cut corner. A diary that shows free time after a cancellation, or after visits entered out of time order, means the free time is kept apart from the visits. A booking refused on Wednesday that was accepted on Tuesday, or a visit from 11:30 refused after one that ends at 11:30, means the overlap check looks at the hour and not the date, or counts touching visits as a clash. A cancelled job that can still be marked done and billed means a customer pays for work that never happened. A repeated or missing invoice number, or a number used up by a refused bill or a restart, means numbering is kept apart from billing.