From 5f53570617f4a5919c23a78da27cd1e6057c0718 Mon Sep 17 00:00:00 2001 From: FuelBoard Contributor Date: Tue, 11 Aug 2026 17:16:55 +0100 Subject: [PATCH] Return all fuel prices per station (E5/E10/DIESEL) so clients switch fuel tabs without refetch --- app/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/main.py b/app/main.py index b17bfa7..da473e4 100644 --- a/app/main.py +++ b/app/main.py @@ -273,6 +273,13 @@ def stations( continue s_lat = station.get("latitude", station.get("lat")) s_lng = station.get("longitude", station.get("lng")) + # All known fuel grades for this station (E5/E10/DIESEL) so clients can + # switch fuel tabs without another request. + prices = {} + for grade in ("E5", "E10", "DIESEL"): + p = _fuel_price(station, grade) + if p is not None: + prices[grade] = p item = { "id": station.get("id") or station.get("station_id"), "name": station.get("name") or station.get("station_name"), @@ -282,6 +289,7 @@ def stations( "lat": s_lat, "lng": s_lng, "price": price, + "prices": prices, "price_updated": station.get("price_updated") or station.get("updated_at"), } if lat is not None and lng is not None and isinstance(s_lat, (int, float)) and isinstance(s_lng, (int, float)):