Add EV charging discovery feature (disabled by flag)

- Create EVChargingService using MapKit POI search for EV chargers
- Add ItineraryBuilder.enrichWithEVChargers() for post-planning enrichment
- Update TravelSection in TripDetailView with expandable charger list
- Add FeatureFlags.enableEVCharging toggle (default: false)
- Include EVChargingFeature.md documenting API overhead

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-01-08 11:31:04 -06:00
parent 8bf8bb49cb
commit bac9cad20b
7 changed files with 740 additions and 32 deletions

View File

@@ -313,11 +313,19 @@ final class TripCreationViewModel {
let result = planningEngine.planItineraries(request: request)
switch result {
case .success(let options):
case .success(var options):
guard !options.isEmpty else {
viewState = .error("No valid itinerary found")
return
}
// Enrich with EV chargers if requested and feature is enabled
if FeatureFlags.enableEVCharging && needsEVCharging {
print("[TripCreation] Enriching \(options.count) options with EV chargers...")
options = await ItineraryBuilder.enrichWithEVChargers(options)
print("[TripCreation] EV charger enrichment complete")
}
// Store preferences for later conversion
currentPreferences = preferences