// BundledDumpProvider.swift — no-network last resort (P0 live chain). // // A REAL snapshot of the mirror dump is bundled into the app (FuelBoardDump // dataset, refreshed before builds by scripts/refresh_bundled_dump.sh) so the // app never demos empty and App Review always sees real data even fully // offline. Same relay envelope, so the shared decode applies unchanged. import UIKit enum BundledDumpProvider { /// The bundled real snapshot, decoded with the shared relay decode — /// nil only if the asset is missing or corrupt (callers then fall back /// to the England-wide sample set). static var stations: [FuelStation]? { guard let asset = NSDataAsset(name: "FuelBoardDump") else { return nil } return try? FuelPriceProvider.decodeStations(from: asset.data) } /// The GOV.UK `data_updated` stamp from the bundled envelope (ISO 8601). /// Labels the offline-data banner honestly ("Offline data from 15 Aug") /// instead of presenting the build's snapshot as live. static var dataUpdatedStamp: String? { guard let asset = NSDataAsset(name: "FuelBoardDump"), let obj = try? JSONSerialization.jsonObject(with: asset.data) as? [String: Any] else { return nil } return obj["data_updated"] as? String } }