From c09d35b65c8810f3fe943a170b46f87d10eaa803 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Wed, 12 Feb 2025 19:43:05 -0800 Subject: [PATCH] implement method in NotificationService --- src/services/NotificationService.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/services/NotificationService.ts b/src/services/NotificationService.ts index a1eb118..573e2fb 100644 --- a/src/services/NotificationService.ts +++ b/src/services/NotificationService.ts @@ -256,6 +256,22 @@ export class NotificationService { * @param deviceId */ public async getAllScheduledNotificationsForDevice(deviceId: string): Promise { - return []; + const scheduledNotifications: ScheduledNotificationData[] = []; + + for (const key of Object.keys(this.deviceIdsToDeliverTo)) { + if (this.deviceIdsToDeliverTo[key].has(deviceId)) { + const tupleKey = TupleKey.fromExistingStringKey(key); + const shuttleId = tupleKey.tuple[0] + const stopId = tupleKey.tuple[1]; + + scheduledNotifications.push({ + shuttleId, + stopId, + deviceId, + }); + } + } + + return scheduledNotifications; } }