add optional dependency inject for apple notification sender

This commit is contained in:
2025-03-24 09:59:29 -07:00
parent 26cdab9907
commit a6ceeb4dfb

View File

@@ -15,14 +15,10 @@ export interface ScheduledNotificationData {
export class ETANotificationScheduler {
public readonly secondsThresholdForNotificationToFire = 180;
private appleNotificationSender = new AppleNotificationSender()
private _lastRefreshedTimeMs: number | undefined = undefined;
get lastRefreshedTimeMs() {
return this._lastRefreshedTimeMs;
}
constructor(private repository: GetterRepository, private shouldActuallySendNotifications = true) {
constructor(private repository: GetterRepository,
private shouldActuallySendNotifications = true,
private appleNotificationSender = new AppleNotificationSender()
) {
this.etaSubscriberCallback = this.etaSubscriberCallback.bind(this);
this.sendEtaNotificationImmediately = this.sendEtaNotificationImmediately.bind(this);
this.etaSubscriberCallback = this.etaSubscriberCallback.bind(this);