Not all charging stations on ChargePeer are grid-tied. Our mobile VTR (Vehicle-to-Rescue) units are battery-powered — they carry their own energy to your location. Until today, there was no way to know how much charge a VTR unit had left before dispatching it. You booked, the unit arrived, and you hoped it had enough range to get you going.
That uncertainty is gone. Every booking card at /bookings now shows real-time battery information for mobile VTR units — a small `BatteryCharging` icon followed by the current battery percentage in monospace text. For the VTR-LIS-04 unit in Lisbon, for example, you will see the battery icon with "92%" next to it — a clear, scannable indicator of the mobile charger's available energy.
The battery level is sourced from the fleet state maintained in-memory on the backend. When a booking involves a mobile VTR unit (identified by the `provider_type` field being "mobile"), the backend looks up the corresponding VTR unit's `battery_level` by matching the VTR ID embedded in the vehicle name. If the VTR name contains "VTR-LIS-04", for instance, its battery level of 92 is returned in the `battery_level` field of the booking response.
For stations that are not mobile — home ports and business hubs connected to the grid — battery level does not apply. Instead, the booking card displays a vehicle type badge: a subtle gray pill showing the `provider_type` value ("home", "business") in a compact monospace badge. This gives the user immediate context about what kind of charger they are booking, without cluttering the card for stationary stations.
The two states are mutually exclusive and clearly differentiated. Mobile VTR units always show battery percentage (they are battery-dependent by nature). Stationary stations always show the type badge. There is no ambiguity and no empty state — every booking card now has one or the other.
Under the hood, the `GET /api/bookings/mine` endpoint now selects `v.icon` and `v.provider_type` from the vehicles table. The battery level is computed per-row by reading the fleet `RwLock` — an efficient in-memory lookup since the fleet is small (single-digit units) and the booking query is limited to 20 rows. The icon field is returned for future use (e.g., displaying the vehicle emoji) but is not yet rendered on the card.
This is a small visual change with meaningful situational awareness. When you are stranded and requesting a mobile VTR, knowing its battery level helps you make an informed decision — is this unit going to have enough range to reach you and deliver a meaningful charge? If a VTR shows 15%, you might want a second unit dispatched in parallel. If it shows 92%, you can book with confidence. And for stationary stations, the type badge helps you distinguish between a home garage port and a commercial charging hub — both useful, but different experiences.