From 80812d25cf70e61dfc1a777d885f2644dc9e9346 Mon Sep 17 00:00:00 2001 From: Hank Date: Mon, 6 Jul 2026 11:48:35 -0700 Subject: [PATCH] StartSession: current-policy awareness (Free / No Parking / paid) Read the CurrentSlot policy: when the meter's current time-of-day window is Free or No Parking, show that status instead of a purchase flow (matches the official app). Confirmed via API: DSB3 9AM-5PM is RateType "Hour" $4/hr with no free grace; the "2 hours free" is a city grace period outside the ParkSmarter payment system. Co-Authored-By: Claude Fable 5 --- app/src/screens/StartSessionScreen.tsx | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/app/src/screens/StartSessionScreen.tsx b/app/src/screens/StartSessionScreen.tsx index 3e48b1e..3b44c6a 100644 --- a/app/src/screens/StartSessionScreen.tsx +++ b/app/src/screens/StartSessionScreen.tsx @@ -51,6 +51,13 @@ export function StartSessionScreen() { const { zone } = useRoute().params; const space = zone.Spaces?.[0]; + // The policy in effect right now (CurrentSlot). Drives whether paid parking is + // even applicable — some windows are Free or No Parking (per the meter's schedule). + const currentPolicy = space?.Policies?.find((p) => p.CurrentSlot); + const currentType = (currentPolicy?.RateType ?? '').toLowerCase(); + const currentlyFree = currentType.includes('free'); + const noParkingNow = currentType.includes('no parking'); + const [vehicles, setVehicles] = useState([]); const [cards, setCards] = useState([]); const [vehicleId, setVehicleId] = useState(); @@ -169,6 +176,32 @@ export function StartSessionScreen() { } }; + // When the current time-of-day policy is Free or No Parking, paid parking + // doesn't apply — show the status instead of a purchase flow (matches the app). + if (currentlyFree || noParkingNow) { + return ( + + {zone.ZoneName} + + + {currentlyFree ? 'Parking is currently free' : 'No parking allowed right now'} + + {currentPolicy?.MessageText && currentPolicy.MessageText !== 'null' ? ( + {currentPolicy.MessageText} + ) : null} + {currentPolicy?.DisplayString ? ( + {currentPolicy.DisplayString} + ) : null} + + + ); + } + if (loading && !ladder.length) { return (