mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
add notification repository as optional dependency
This commit is contained in:
@@ -2,15 +2,22 @@ import { ShuttleGetterRepository } from "../../repositories/ShuttleGetterReposit
|
||||
import { TupleKey } from "../../types/TupleKey";
|
||||
import { IEta } from "../../entities/entities";
|
||||
import { AppleNotificationSender, NotificationAlertArguments } from "../senders/AppleNotificationSender";
|
||||
import { NotificationLookupArguments, ScheduledNotification } from "../../repositories/NotificationRepository";
|
||||
import {
|
||||
NotificationLookupArguments,
|
||||
NotificationRepository,
|
||||
ScheduledNotification
|
||||
} from "../../repositories/NotificationRepository";
|
||||
import { InMemoryNotificationRepository } from "../../repositories/InMemoryNotificationRepository";
|
||||
|
||||
type DeviceIdSecondsThresholdAssociation = { [key: string]: number };
|
||||
|
||||
export class ETANotificationScheduler {
|
||||
public static readonly defaultSecondsThresholdForNotificationToFire = 180;
|
||||
|
||||
constructor(private shuttleRepository: ShuttleGetterRepository,
|
||||
private appleNotificationSender = new AppleNotificationSender()
|
||||
constructor(
|
||||
private shuttleRepository: ShuttleGetterRepository,
|
||||
private notificationRepository: NotificationRepository = new InMemoryNotificationRepository(),
|
||||
private appleNotificationSender = new AppleNotificationSender()
|
||||
) {
|
||||
this.etaSubscriberCallback = this.etaSubscriberCallback.bind(this);
|
||||
this.sendEtaNotificationImmediately = this.sendEtaNotificationImmediately.bind(this);
|
||||
|
||||
Reference in New Issue
Block a user