Skip to content

fix(ev): label straight-line plans, member rates and availability time - #735

Merged
Medformatik merged 1 commit into
mainfrom
claude/confident-volta-2tlyvq
Nov 1, 2026
Merged

Medformatik merged 1 commit into
mainfrom
claude/confident-volta-2tlyvq

Conversation

@Medformatik

@Medformatik Medformatik commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

What changed and why

Three places where an EV plan read as more certain than it is:

  • Straight-line distances. When the routing engine gives no road matrix (getMatrix fails or isn't offered), integrations/routing/ev-plan.ts falls back to greatCircleMatrix and only logged it. The plan now carries a straight-line-distances warning, and the card shows an info note: "Road distances between charging stops were unavailable, so this plan uses straight-line estimates. Charge times and arrival charge may differ."
  • Member and roaming rates. When no ad-hoc tariff prices a session, the planner costs the cheapest tariff of another type, such as a profile, member or roaming rate. That price was shown as if anyone could pay it. SessionCost now reports the costed tariff's tariffType. Stops costed on a stated non-ad-hoc type carry contractTariff: true, and the card adds "member or roaming rate" beside the price. Ad-hoc and untyped tariffs are unchanged.
  • Availability time. The card showed "3 of 6 available" without a time, although availability.updatedAt was already sent. It now reads "3 of 6 available as of 10:00", in the browser's locale and time zone. Without updatedAt, the old text stays.

The new response fields are optional. /directions/ev declares no response schema, so they are not dropped and the OpenAPI document is unchanged. Text is in English and German.

Related work

Fixes #413.

Verification

  • New tests:

    • planner: tariffType is passed through for profile, ad-hoc and untyped tariffs;
    • adapter: the warning appears on matrix failure and not when the matrix answers; contractTariff is set for a profile tariff and absent for ad-hoc and untyped tariffs;
    • card: the availability time, the contract label and the straight-line note.

    Against the old code, the six tests for new behaviour fail; the rest pass.

  • vitest run on the three affected test files: 90 passed.

  • tsc --noEmit: passes for packages/core, packages/ev-charge-planner, apps/web (main and integrations configs) and apps/api (integrations config).

  • Biome on the changed files and pnpm check-translations: pass (0 errors).

  • scripts/check-release-information.mjs with this description: passes.

Not performed: screenshots or a browser check of the card; the maintainer asked to skip them. The full test suite is left to CI.

Release and upgrade impact

No package release: built with pnpm build from main and from this branch, @openmapx/extension-cli's dist output (cli.js plus two chunks) is identical once content-hashed chunk names and absolute module-path comments are normalized.

Three places where the EV plan read as more certain than it is:

- When the routing engine gives no road matrix, the planner silently
  used straight-line distances between candidate stops. It now adds a
  `straight-line-distances` warning, and the plan card says charge
  times and arrival charge may differ.
- When no ad-hoc tariff prices a session, the cheapest member, roaming
  or profile tariff was shown as the stop's price. Stops costed on a
  stated non-ad-hoc tariff now carry `contractTariff` and the card adds
  "member or roaming rate".
- Charger availability showed counts without saying when they were
  reported. The card now adds "as of HH:MM" from `updatedAt`.

Refs #413
@Medformatik
Medformatik merged commit 731b929 into main Nov 1, 2026
48 of 65 checks passed
@Medformatik
Medformatik deleted the claude/confident-volta-2tlyvq branch November 1, 2026 18:22
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Label EV plan fallbacks, non-ad-hoc tariffs and availability time

1 participant