A dispatch plan that checks driving hours on every drag
The plan shows today and the next two days with the tractors as rows, their trips as blocks and the orders without a truck in a tray beside them. While an order is in the hand, every row says whether its driver could take it under the drivers' hours rules, and the row under the pointer draws the drives and rests the trip would need. A drop that breaks the rules is refused with the reason in words and the trucks where it fits, best first.
By Bohuslav PoláčekChecked
What the board shows
- The tray: the orders without a truck, each with its customer, kind of cargo, route, load and its loading and unloading slots.
- The rows: one tractor each, its trailer, its driver and the driving the driver has left today, read from the tachograph counters.
- The hours: 24px an hour across three days, nights from 22:00 to 6:00 shaded, a line every three hours and the now line with its time. The board opens two hours before now.
- The blocks: each trip in the hue of its kind of cargo, dashed while only accepted, solid on the road, with a check once delivered. The workshop is hatched, and a trip that already breaks the rules carries a warning dot that says why.
What every row says during a drag
The check runs for every tractor the moment an order leaves the tray, so the dispatcher sees the answer before letting go, not an error after it. The row under the pointer draws what the check plans for that driver: the drives, the 45-minute breaks and the rests.
| The row says | Why |
|---|---|
| Fits, arrives 17:00 | The trip keeps to the rules; the time is when it reaches the customer. |
| Wrong trailer | Chilled loads need a reefer, oversized ones a low-loader; the rest go on a curtain-sider or a mega. |
| In the workshop | The truck is booked in for service during the trip. |
| Has another trip | Another trip overlaps it, with an hour's margin either side. |
| Daily rest halfway | The 11-hour daily rest falls inside the trip, so it misses its slot. |
| Weekly rest | The 45-hour weekly rest starts during the trip. |
| Misses the slot | The driving alone would bring it in after the unloading slot. |
| 56 h a week used | The week's driving would run out. |
| 90 h in two weeks used | The fortnight's driving would run out. |
| Delays another trip | The driver's next trip would then miss its own slot. |
After the drop
A trip that fits is assigned at once, written into the shipment's and the truck's history, and the toast offers Undo. One that does not is not made: the card goes back to the tray with a nudge and a dialog names the reason, such as "The 11-hour daily rest falls in the middle of the trip", with the tractors where it fits, best first.
An accepted block can be dragged to another truck or back to the tray. Enter or Space on any card opens the same choice of tractors, so the plan works without a mouse, and on a phone it becomes a list: the orders first, then each truck's three days. It is a workspace screen, one of the kit's 9 screen types (the screen types).
What AI coding tools get wrong here
Asked for a dispatch board, a coding tool draws a timeline that checks only whether two blocks overlap, then lets the drop happen and shows a red banner. The hard part is the reason under the pointer, and it needs the driver's counters, the trip's driving time and the rules in one place.
Here one module, domain/hours.ts, answers "may this trip go to this truck?" for the board, the keyboard dialog, the api that saves and the finder of loads back, so all four give the same reason in the same words. The kit's ResourceTimeline moves its own blocks but takes no drop from outside and says only that a spot is taken, so this board is the app's own, built on the kit's tokens, hues and status glyphs. Who may do what is a rule too: dispatch, the warehouse and management open the board (plan.read), only dispatch assigns on it (shipment.assign).
The rules the check plans by
export const drivingRules = {
dailyDrive: 9 * HOUR,
extendedDailyDrive: 10 * HOUR,
extendedDaysPerWeek: 2,
weeklyDrive: 56 * HOUR,
fortnightDrive: 90 * HOUR,
driveBeforeBreak: 4.5 * HOUR,
break: 45 * MINUTE,
dailyRest: 11 * HOUR,
/** 24 h minus the daily rest: the longest a duty may run. */
dutySpan: 13 * HOUR,
weeklyRest: 45 * HOUR,
/** Six 24-hour periods from the end of one weekly rest to the start of the next. */
weeklyRestWithin: 6 * PERIOD,
/** Regulation (EU) No 581/2010: the driver card at least every 28 days, the vehicle unit every 90. */
driverCardDownloadDays: 28,
vehicleUnitDownloadDays: 90,
} as const;Questions
Does the board stop a plan that breaks the driving hours?
Yes. A drop on a row that cannot take the trip is refused, and the dialog says why and offers the tractors where it fits. A trip planned before a change that now breaks the rules keeps a warning dot with the reason.
Which rules does the check use?
Regulation (EC) No 561/2006 as GB and EU hauliers plan by it: 9 hours of driving a day or 10 on two days a week, a 45-minute break after 4 hours 30, an 11-hour daily rest, a 45-hour weekly rest, 56 hours a week and 90 in two weeks. The reduced rests are left to the dispatcher.
Can a dispatcher plan without dragging?
Yes. Enter or Space on an order opens the choice of tractors, best first, each with its verdict, and the same check decides.
What does the plan look like on a phone?
A list: the orders without a truck first, each opening the choice of tractors, then every truck with its driving left and its trips of the three days.
Can the customer follow the delivery?
Yes. A customer signs in to their firm's shipments with the route, the state, the unloading slot, the ETA and the haulier's messages, and never sees the driver's phone, the plate or the price.
Two ways
Build it yourself, or have it built
Build it yourself
Build your app on the framework
Get the codebase these apps stand on and build yours with Claude Code, Cursor or Codex.
One payment, lifetime updates
Get the frameworkHave it built
Have us build your app
Tell us how your team works. We plan the app with you and build it on the same framework at a fixed price.
After launch, Care keeps it improving, from €99 a month.
from €1,990
Describe your app