add method to check if notification is scheduled

This commit is contained in:
2025-03-27 10:46:38 -07:00
parent 3761f43909
commit a665c29745
2 changed files with 6 additions and 0 deletions

View File

@@ -42,6 +42,10 @@ export class InMemoryNotificationRepository implements NotificationRepository {
return this.deviceIdsToDeliverTo[tuple.toString()][deviceId];
}
async isNotificationScheduled(lookupArguments: NotificationLookupArguments): Promise<boolean> {
return await this.getSecondsThresholdForNotificationIfExists(lookupArguments) !== null;
}
async addOrUpdateNotification({
shuttleId,
stopId,
@@ -71,4 +75,5 @@ export class InMemoryNotificationRepository implements NotificationRepository {
delete this.deviceIdsToDeliverTo[tupleKey.toString()][deviceId];
}
}