Toll Sync Architecture
HostMetrics supports automatic toll transaction syncing from three US toll providers.Supported Providers
| Provider | Region | Columns |
|---|---|---|
| NTTA | Texas (Dallas/Fort Worth) | Transaction Date, Transaction Time, Plaza/Gantry Name, Roadway, Amount, Tag Number, Vehicle |
| EZPass | Northeast US | Date, Time, Plaza, Agency, Amount, Tag ID, Plate |
| SunPass | Florida | Date, Time, Plaza, Road, Amount, Transponder, Plate Number |
System Architecture
Manual CSV Import Flow
Date Handling (Critical)
Toll dates are stored as plaindate + text time fields — NOT as UTC timestamps.
Why? Toll agencies report transactions in their operating timezone (e.g., NTTA uses CST). Since the host is typically in the same timezone as the agency, the dates are already correct for trip matching.
The Rule: Never use toISOString() when parsing toll dates. It converts to UTC and can shift the date by ±1 day.
Trip-to-Toll Matching
Tolls are matched to trips by comparing dates:- Trip
trip_enddate (converted from UTC to user’s business timezone usingformatDateTime()) - Toll
transaction_date(stored as-is in agency local time) - Both are compared as
YYYY-MM-DDstrings
Lambda Worker Architecture
toll_accounts for active accounts and invokes a worker Lambda for each one. Workers scrape the toll portal, parse transactions, and insert them directly into Supabase.