# בחירת ספקי אנרגיה

> תיעוד מקור. מקור: docs/provider-preferences.md · 6a466bf.
> בגרסה הציבורית הושמטו מזהים תפעוליים ופרטי חשבון אישיים. קובץ המקור נשמר במאגר.

Each Personal, Family, Business or Enterprise workspace chooses its own charging and fuel providers. New workspaces default to no approvals; adding catalogue entries never expands an existing selection. The same picker appears during platform onboarding and inline personal onboarding on the vehicle page. Customers manage their choices later at `/providers` or `/platform/<tenant>/providers`; the workspace dashboard includes a summary and management link.

A signed-in driver's map is restricted to the charging providers selected for the explicitly displayed workspace. Switching workspaces reloads preferences. Map points, lists, favourites, nearest results, station details, provider options, and geography counts/addresses use the same exact-ID provider intersection. Fuel identities never expand to a charging brand through an alias. Loading, failed or empty selections never fall back to all networks. “All networks · browse” opens the separate public `/network` catalogue without changing account preferences. A direct station link for an unselected provider shows a selection notice instead of that station's detail. The provider manager's map link keeps the current account and mode.

Only verified supplier identities appear in the product directory and selection. The directory contains twelve charging networks: ON-EV, SONOL EVI, EV Edge, ZEN Energy, ViMore, Scala Energy, Paz Charge/yellow, Gnrgy Go, Green Spot, Enova, Elexify and GREEMS. Five fuel supplier identities are also available: Paz/Pazomat, Delek/Dalkan, Sonol, Dor Alon/Speedomat and Ten. Ten is listed as a verified fuel supplier/app identity; no unverified business-card brand is asserted. Supplier identity verification is separate from integration readiness.

Charging map, city, location and station discovery remain restricted to providers whose `energy_sources` includes `electricity`. Fuel suppliers do not become charging operators or create invented fuel stations. Existing `source-*` charging IDs, all 1,773 verified charging locations and favourites remain unchanged; archived source records stay in the database for provenance and foreign-key integrity. The original government source contains 2,261 records. No provider is technically integrated, and selection does not enable charging, fueling, payment, a supplier account or automatic transaction synchronization.

## Persistence and authorization

- `ev1_provider_preferences` stores completion/revision, actor and timestamp; absent means not yet configured, while an empty saved choice explicitly revokes all approvals.
- `ev1_tenant_providers` stores only individually approved operator IDs. “Select all” submits the current eligible IDs, never a wildcard or consent to future providers.
- All active workspace members may read. Owner, admin and fleet manager may save. Direct browser writes are denied; a public invoker RPC calls a guarded private function. RLS applies to reads, and no service-role key is required in the product.
- Saving atomically replaces selection using an advisory lock and expected revision. Stale writes return HTTP 409 rather than overwrite another editor. The UI retains the draft and offers to load the current saved choice.
- Onboarding creation and initial selection are one database transaction. Retries do not overwrite an existing selection. Invalid choices roll back the new workspace. Existing callers that omit choices still create a workspace with no selected providers.
- Audit triggers record changes and derive the actor from the authenticated JWT. API responses are private/no-store; provider preferences never enter the shared public map cache.
- Future charging adapters must check tenant approval in addition to role, active credentials, provider readiness, policy and payment authorization. There is no live charging command route in this release.

## Brand assets

Original assets are served locally from `public/providers`; source URLs and retrieval dates are recorded in `lib/reference/provider-logos.json`. Wordmarks come from official provider sites. Scala's original application icon comes from the official Scala Smart Energy listing on Google Play because the official website returned 403/522 during retrieval. Green Spot uses its official website wordmark. Gnrgy Go, Enova and Elexify use their official Google Play application icons; GREEMS uses its official App Store artwork. Their original bytes and SHA-256 hashes are recorded in the manifest. The unverified EV Energy mark has been removed. No corporate logo or operator affiliation is fabricated. Provider marks remain their owners' property and do not imply partnership.

## Verification

- 98 unit checks, TypeScript and ESLint, production build.
- 14 provider-specific PostgreSQL checks: default deny, persistence, tenant isolation, anonymous access, read-only roles, forged direct writes, revision conflicts, invalid IDs, revocation, future-provider exclusion, idempotency, atomic onboarding rollback, audit attribution and suspended membership.
- 28 existing tenant-isolation checks remain passing; all local SQL fixtures roll back.
- 21 browser checks including individual/all/revoke selection, persistence after reload, workspace switching, onboarding, official logo loading, 320/390px layouts, national map and vehicle search regression.
- Production deployment and authenticated verification are recorded in the release note.

## Production verification — 2026-11-08

Final runtime: `e1b48b42cf6a0edd321e9a5c17a36414c6076e3b`, Vercel deployment `[operational-id-redacted]`, READY at <https://product.linknodesenergy.com/providers>.

21 authenticated production checks passed using a disposable Clerk identity: real onboarding selection, dashboard summary, reload persistence, select all, revocation, optimistic conflict HTTP 409, personal/business workspace isolation, mobile layout and state clearing on sign-out. Selecting only ON-EV produced 503 map locations; a workspace without selections produced zero; explicit all-network exploration produced 2,261 and left approvals unchanged.

Production validation found and resolved a missing PUT route export. It also caught PostgREST retrying the original SQLSTATE 40001 on optimistic conflicts; the follow-up migration uses PT409 for an immediate conflict response. A local HTTP regression now verifies that PUT reaches the same-origin/authentication checks, and the final real-account run verifies conflict behavior through Vercel and PostgREST.

All eight deployed original assets matched local SHA-256 hashes. A separate production browser check verified successful decoding and visible boxes for all seven selectable network logos on mobile. The first full-page screenshots were captured before offscreen lazy-loaded logos completed; use `[local-path-redacted]` for the verified logo rendering. The QA helper now waits for each logo before capturing future mobile screenshots.

Security advisor: no new table warnings; six INFO notices concern existing private, deliberately default-deny tables. See the [RLS policy advisory](https://supabase.com/docs/guides/database/database-linter?lint=0008_rls_enabled_no_policy). Both new customer tables have RLS, authenticated SELECT, and no direct authenticated write grants.

Rollback: restore the prior product deployment `[operational-id-redacted]`; additive provider tables and the original tenant creation RPC remain compatible. This release changes only the product deployment; website and corporate-admin deployments are untouched.

The temporary Clerk identity was deleted, its sessions revoked, and all four temporary workspaces (including two earlier verification attempts) were removed after ownership, membership and empty operational-data guards. Final checks found zero temporary workspaces, memberships or approvals and the tenant audit trigger enabled. The cleanup changed no customer records.

## Directory update — 2026-11-09

The owner confirmed the five new identities, including GREEMS. The migration promotes those five rows without changing capabilities, tenant selections or existing verified providers. Product APIs now consistently restrict operator and location discovery to verified identities. New providers are available to select, including with “select all”; they are never automatically added to existing workspace approvals. No charging or payment integration is activated by identity verification.

## Fuel supplier directory — 2026-11-10

- Additive migration `20261110132059_fuel_provider_directory.sql` adds constrained public energy-type metadata and five distinct `fuel-*` identities. Existing charging IDs, aliases, integration status, capabilities, customer choices and preference revisions are preserved.
- The existing selection RPC, roles, optimistic revision checks and transactional onboarding apply unchanged to fuel suppliers across all four plans. Imports use the separate unified-energy API; choosing a supplier does not grant transaction access or certify supplier evidence.
- Charging ingestion filters its alias map by electricity before matching government records. Shared names such as Paz, Sonol and Dor Alon cannot remap charging locations to fuel-only identities.
- The shared product picker and account summaries show the new brands. The company home, plans, driver and fleet pages render the same versioned public catalogue statically; website surface restrictions on reference and tenant APIs remain unchanged.
- Original fuel-brand assets and supplier-published app icons are recorded in `lib/reference/provider-logos.json`; all existing charging assets are preserved. See [fuel supplier sources](/fuel-provider-sources) for official evidence, hashes, asset distinctions and source notices.
- Release checks cover the 17-entry directory, mixed selections, no automatic approval, all four plan onboarding flows, fuel exclusion from every charging lookup, original image decoding at 1440/390/320px, and existing pricing and website forms. CI runs the isolated PostgreSQL and importer alias regressions before release.

This addition is supplier discovery and customer preferences. It does not add fuel authorization, live partner adapters, transaction fees, a fuel-station map or a redesigned customer workflow.

## Account discovery filter correction — 2026-11-10

The earlier in-map all-network exploration and unselected station-detail behavior described in the November 8 release are superseded by the account-scoped rule above. The shared public map cache and `/network` directory remain public; private selections are intersected only in account discovery and are never written into public reference data or caches.

Selecting Pazomat and Paz Charge includes only Paz Charge charging locations that actually exist in the imported catalogue. At verification the public catalogue contained no Paz Charge locations, so this selection correctly produces zero results and explains the coverage gap. Synthetic positive Paz Charge locations in tests exercise filtering only; they do not assert live coverage or integration. Empty/fuel-only choices, public browsing, selected-but-unrepresented providers, foreign station links, account switching, geography, map/list and favourites have dedicated regressions.
