Skip to content

feat: travel to a site near the base bills nothing, inside a free radius - #230

Open
TylerVigario wants to merge 2 commits into
mainfrom
feat/a-free-radius
Open

TylerVigario wants to merge 2 commits into
mainfrom
feat/a-free-radius

Conversation

@TylerVigario

Copy link
Copy Markdown
Owner

Refs #222. Its fourth PR: the free radius.

Travel to a site near the base is often not billed at all: free within so many miles, and the whole trip beyond. reckon billed every mile and every minute it drove, so the liquor store in town was billed for mileage.

What changes

  • Settings → Travel keeps a free radius (free_radius), in miles one way from the base, dated as a price is:
    • a change is a new row, and an earlier day is allowed;
    • a second one from the same day replaces the first until that day has passed;
    • a coming one shows as Scheduled, and can be taken back until its day;
    • a row with no miles means no free radius from that day.
  • A site is inside it when half its round trip, typed or Google's, is at or within the radius in force on the day the trip was driven. Nothing the trip drove for that site bills, its miles or its time, and the rest of the trip bills as it would. Woodland then the clinic: the drive to Woodland bills, while Woodland to the clinic and the way home are the clinic's, and free.
  • A site whose drive isn't known bills, and so does a stop at an address that is no site: neither can be said to be inside.
  • What a drive pays follows its rule:
    • drive time paid by the hour still pays everyone in the vehicle;
    • a vehicle paid a share of what its miles billed is paid nothing for free miles;
    • a fixed sum pays as it does.
  • On screen:
    • the trip form and the trip say "Free: within 15 miles" on each free drive, and how much of the trip is free;
    • Unbilled moves free travel from To bill to Not billable, beside the hours given away;
    • a site's page says whether travel there is free, or beyond the radius, or that its drive isn't known.
  • The demo: free within 15 miles from a month ago, so the clinic in Elverta (28 miles there and back) is driven free. Its visit forty days ago, on INV-0204, was before then and billed.

Checks

  • Unit:
    • the radius in force is the latest started by the day, or none;
    • a site is free at the radius itself, and bills a tenth of a mile beyond it;
    • a site whose drive isn't known bills, as does an address that is no site and a leg nobody caused;
    • a radius reads as "15 miles", "12.5 miles", "1 mile".
  • Schema guards (section 64): a second radius from the same day, a radius of no miles or less, and one from no day are refused; no free radius from a day is allowed.
  • write-check:
    • a radius of no miles, one finer than a tenth, and one from no day are refused;
    • a scheduled one saves, is corrected rather than doubled before its day, and is taken back;
    • one from a day long past saves, and is then neither rewritten nor taken back.
  • trips-check: Woodland then the clinic, which is inside the radius:
    • its miles bill $13.86, Woodland's 21, with the clinic's 36 free, and the Tacoma is paid $12.47;
    • Woodland's 30 minutes bill $22.50 as Drive time, all 85 pay Avery $29.75, and it keeps -$5.86;
    • with Sam riding, $37.50 bills for two, Sam is paid $34.00, and it keeps -$24.86;
    • the saved trip says which drives are free, and a change to Woodland's miles bills again.
  • On a scratch cluster: smoke, access (56), write (350), trips and pay pass, and 685 unit tests.
  • Screens at 390 px:
    • Settings → Travel, with a scheduled radius, and its dialog;
    • a new trip to the clinic;
    • Sam's trip today;
    • Unbilled, both views;
    • the clinic's page and Woodland's.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TsLtVyutCz6jx8goTac4Mf

TylerVigario and others added 2 commits December 1, 2026 11:19
The business keeps a free radius on Settings → Travel (free_radius), in
miles one way from the base, dated as a price is. A change is a new row, an
earlier day is allowed, one from the same day replaces it until that day
has passed, a coming one shows as Scheduled and can be taken back, and a row
with no miles means no free radius from that day.

A site is inside the radius when half its round trip, typed or Google's, is
at or within the one in force on the day the trip was driven. Then nothing
the trip drove for it bills, its miles or its time. The rest of the trip
bills as it would, and what each drive pays follows its rule. A site whose
drive is not known bills, and so does an address that is no site.

The trip form and the trip say which drives are free and by what radius.
Unbilled moves free travel from To bill to Not billable, beside the hours
given away, and a site's page says whether travel there is free. The demo is
free within 15 miles from a month ago, so the clinic in Elverta is driven
free. Guard section 64 holds the table's rules.

Refs #222

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

This branch has not been deployed

No deployments
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