add bindings and redis client arg for constructor

This commit is contained in:
2025-03-31 19:35:38 -07:00
parent bef2ce18fb
commit c98367f12e

View File

@@ -4,10 +4,24 @@ import {
NotificationRepository,
ScheduledNotification
} from "./NotificationRepository";
import { createClient, RedisClientType } from "redis";
class RedisNotificationRepository implements NotificationRepository {
addOrUpdateNotification(notification: ScheduledNotification): Promise<void> {
return Promise.resolve(undefined);
constructor(
private redisClient = createClient({
url: process.env.REDIS_URL,
}),
) {
this.getAllNotificationsForShuttleAndStopId = this.getAllNotificationsForShuttleAndStopId.bind(this);
this.getSecondsThresholdForNotificationIfExists = this.getSecondsThresholdForNotificationIfExists.bind(this);
this.deleteNotificationIfExists = this.deleteNotificationIfExists.bind(this);
this.addOrUpdateNotification = this.addOrUpdateNotification.bind(this);
this.isNotificationScheduled = this.isNotificationScheduled.bind(this);
this.subscribeToNotificationChanges = this.subscribeToNotificationChanges.bind(this);
this.unsubscribeFromNotificationChanges = this.unsubscribeFromNotificationChanges.bind(this);
}
public async addOrUpdateNotification(notification: ScheduledNotification): Promise<void> {
}
public async deleteNotificationIfExists(lookupArguments: NotificationLookupArguments): Promise<void> {