From 1d98e8450e3963a9afffe11e2571bd15d2347ab0 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Thu, 20 Nov 2025 16:26:25 -0800 Subject: [PATCH] Update InterchangeSystemBuilderArguments with new properties for controlling event emitter degree delta --- src/entities/InterchangeSystem.ts | 16 +++++++++++++++- src/index.ts | 2 ++ testHelpers/apolloTestServerHelpers.ts | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/entities/InterchangeSystem.ts b/src/entities/InterchangeSystem.ts index 985a819..8ed86d3 100644 --- a/src/entities/InterchangeSystem.ts +++ b/src/entities/InterchangeSystem.ts @@ -46,7 +46,21 @@ export interface InterchangeSystemBuilderArguments { * Controls whether to self-calculate ETAs or use the external * shuttle provider for them. */ - useSelfUpdatingEtas: boolean + useSelfUpdatingEtas: boolean; + + /** + * The size of the threshold to detect when a shuttle has arrived + * at a stop, in latitude/longitude degrees. + */ + shuttleStopArrivalDegreeDelta: number; + + /** + * The size of the threshold to detect when a shuttle is "near" + * a stop, in latitude/longitude degrees. To determine this value, + * find the distance at which the shuttle would normally take + * ~1 minute to reach the next stop. + */ + shutleStopNearbyDegreeDelta: number; } export class InterchangeSystem { diff --git a/src/index.ts b/src/index.ts index a8fd797..03cd30f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -24,6 +24,8 @@ const supportedSystems: InterchangeSystemBuilderArguments[] = [ parkingSystemId: ChapmanApiBasedParkingRepositoryLoader.id, name: "Chapman University", useSelfUpdatingEtas: true, + shuttleStopArrivalDegreeDelta: 0.001, + shutleStopNearbyDegreeDelta: 0.003, } ] diff --git a/testHelpers/apolloTestServerHelpers.ts b/testHelpers/apolloTestServerHelpers.ts index 60a8355..83f3173 100644 --- a/testHelpers/apolloTestServerHelpers.ts +++ b/testHelpers/apolloTestServerHelpers.ts @@ -25,6 +25,8 @@ const systemInfoForTesting: InterchangeSystemBuilderArguments = { passioSystemId: "263", parkingSystemId: ChapmanApiBasedParkingRepositoryLoader.id, useSelfUpdatingEtas: false, + shuttleStopArrivalDegreeDelta: 0.001, + shutleStopNearbyDegreeDelta: 0.003, }; export function buildSystemForTesting() {