implement method in NotificationService

This commit is contained in:
2025-02-12 19:43:05 -08:00
parent c1ec50db7b
commit c09d35b65c

View File

@@ -256,6 +256,22 @@ export class NotificationService {
* @param deviceId * @param deviceId
*/ */
public async getAllScheduledNotificationsForDevice(deviceId: string): Promise<ScheduledNotificationData[]> { public async getAllScheduledNotificationsForDevice(deviceId: string): Promise<ScheduledNotificationData[]> {
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;
} }
} }