Skip to content

feat: a trip names everyone in the vehicle, and its time bills and pays by the head - #229

Merged
TylerVigario merged 2 commits into
mainfrom
feat/everyone-in-the-vehicle
Dec 1, 2026
Merged

TylerVigario merged 2 commits into
mainfrom
feat/everyone-in-the-vehicle

Conversation

@TylerVigario

Copy link
Copy Markdown
Owner

Refs #222. Its third PR: everyone in the vehicle.

A trip named who drove it and nobody else, so two people driving out to a job together were one person's time on the road: billed for one, and paid to one.

What changes

  • A trip names who rode in it beside whoever drove, as a team entry names its crew (trip_rider). The trip form asks under "Also in the vehicle", and the Driving screen under "Also in it". The choice is anyone on the team besides the driver, so someone with Field, who records only trips they drove, can still name who rode with them.
  • Its time bills at the head count: the rate for the first person, then the additional rate for each one after, as a team's hour does. Settings → Travel already sets Drive time's additional rate. Its miles are the vehicle's, and bill as they did.
  • Each person in the vehicle is paid for the drive's time by their own time rule on Drive time. Each is owed it, paid it and reported apart. Pay owed says "riding, 2 in the vehicle" or "driving, 2 in the vehicle". The pay report counts each person's drive pay under what they're paid as, and names the riders.
  • The database refuses the wrong ones:
    • whoever drove named as a rider too (a_driver_is_not_a_rider);
    • a change to who rode once the trip's time is billed or paid (who_rode_stands). A billed hour stands the same way, refused by the database rather than left to whatever saves the trip.
  • Someone with Field sees a trip they rode in, as team work they were on. They see only their own pay on it, and can change only a trip they recorded. Their phone keeps for no signal only the trips they drove, as before.
  • On screen:
    • the trip says who drove and who was with them, and What it pays lists each person, then the vehicle's owner;
    • Trips says "Avery Lind, with Sam Ortega";
    • Change opens with the riders ticked.
  • The demo: Drive time bills $30.00 an hour more for each other person, and Sam rides beside Avery to Woodland a week ago.

Checks

  • Unit:
    • a leg of time bills at the head count, the rate and then the additional rate;
    • a leg of miles bills at one rate however many are in the vehicle;
    • each person aboard is paid for the same drive by their own rule;
    • a trip being driven keeps its riders through to the trip form.
  • Schema guards (section 63):
    • whoever drove is refused as a rider, and so is the same rider twice;
    • a rider is refused as the new driver while still riding;
    • a rider can be taken off while nothing is billed or paid, but not once the trip's time is paid or billed, nor moved off a billed trip;
    • billing only a trip's miles leaves who rode free to change.
  • write-check:
    • whoever drove named as a rider too, and a rider who isn't one of ours, are refused;
    • a trip with a rider named twice is recorded with them once, and what it pays lists the driver and the rider.
  • trips-check:
    • ticking Sam on the trip form bills its 85 minutes for two, $106.25, pays Sam $34.00 for riding along and keeps $46.26; unticked, it goes back to one;
    • a trip driven with Sam in it is saved with Sam riding.
  • pay-check: Sam is owed for the ride beside Avery, at Sam's own $24.00 an hour.
  • access-check:
    • Field is shown the trips they drove or rode in, and a trip they weren't in doesn't open;
    • each phone keeps only the trips its person drove. This replaces a test that looked for the other person's name, which a rider's name on their own trip would now set off.
  • On a scratch cluster: smoke, access (56), write (341), trips and pay pass, and 677 unit tests.
  • Screens at 390 px:
    • a new trip with Sam;
    • the demo's trip, as Avery and as Sam;
    • Trips;
    • what Sam is owed;
    • setting off with someone in it;
    • Change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TsLtVyutCz6jx8goTac4Mf

TylerVigario and others added 2 commits November 30, 2026 20:58
…ys by the head

A trip names who rode in it beside whoever drove, as a team entry names its
crew (trip_rider). The trip form and the Driving screen ask who else was in
the vehicle, from anyone on the team besides the driver.

A trip's time bills as Drive time at the head count, the rate for the first
person and the additional rate for each after, as a team's hour does. Each
person in the vehicle is paid for it by their own time rule on Drive time,
and is owed it, paid it and reported apart. Its miles are the vehicle's, and
bill and pay as they did.

Whoever drove is not a rider too (a_driver_is_not_a_rider), and who rode
stands once the trip's time is billed or paid (who_rode_stands), both
refused by the database. Someone with Field sees a trip they rode in, as team
work they were on, with only their own pay; they change only a trip they
recorded, and their phone keeps for no signal only the trips they drove.

The trip screen says who was in it, and What it pays lists each of them.
Trips names the riders, a person's pay lists their ride, and the pay report
counts each person's drive pay as what they are paid as. The demo's Drive
time bills $30.00 more for each other person, and Sam rides beside Avery to
Woodland. Guard section 63 holds the rest.

Refs #222

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TsLtVyutCz6jx8goTac4Mf
… name

Sam rides beside Avery on one of her trips, so Sam's name is on her Trips
list as her rider. The offline check said Trips was kept as Avery's own when
no "Sam Ortega" appeared on it; it now says so when each trip the kept list
links is one kept as hers, and Sam's own drive is not among them, as the
access check already does.

Refs #222

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TsLtVyutCz6jx8goTac4Mf
@TylerVigario
TylerVigario merged commit 9b49f52 into main Dec 1, 2026
12 checks passed
@TylerVigario
TylerVigario deleted the feat/everyone-in-the-vehicle branch December 1, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant