Repository navigation
fix(ev): label straight-line plans, member rates and availability time - #735
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
Three places where an EV plan read as more certain than it is:
getMatrixfails or isn't offered),integrations/routing/ev-plan.tsfalls back togreatCircleMatrixand only logged it. The plan now carries astraight-line-distanceswarning, 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."SessionCostnow reports the costed tariff'stariffType. Stops costed on a stated non-ad-hoc type carrycontractTariff: true, and the card adds "member or roaming rate" beside the price. Ad-hoc and untyped tariffs are unchanged.availability.updatedAtwas already sent. It now reads "3 of 6 available as of 10:00", in the browser's locale and time zone. WithoutupdatedAt, the old text stays.The new response fields are optional.
/directions/evdeclares 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:
tariffTypeis passed through for profile, ad-hoc and untyped tariffs;contractTariffis set for a profile tariff and absent for ad-hoc and untyped tariffs;Against the old code, the six tests for new behaviour fail; the rest pass.
vitest runon the three affected test files: 90 passed.tsc --noEmit: passes forpackages/core,packages/ev-charge-planner,apps/web(main and integrations configs) andapps/api(integrations config).Biome on the changed files and
pnpm check-translations: pass (0 errors).scripts/check-release-information.mjswith 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 buildfrommainand from this branch,@openmapx/extension-cli'sdistoutput (cli.jsplus two chunks) is identical once content-hashed chunk names and absolute module-path comments are normalized.