mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
add notification event subscriber/unsubscriber
This commit is contained in:
@@ -14,10 +14,18 @@ export interface ScheduledNotification extends NotificationLookupArguments {
|
|||||||
secondsThreshold: number;
|
secondsThreshold: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface NotificationEvent {
|
||||||
|
notification: ScheduledNotification,
|
||||||
|
event: 'delete' | 'addOrUpdate'
|
||||||
|
}
|
||||||
|
|
||||||
export interface NotificationRepository {
|
export interface NotificationRepository {
|
||||||
getAllNotificationsForShuttleAndStopId(shuttleId: string, stopId: string): Promise<ScheduledNotification[]>;
|
getAllNotificationsForShuttleAndStopId(shuttleId: string, stopId: string): Promise<ScheduledNotification[]>;
|
||||||
getSecondsThresholdForNotificationIfExists(lookupArguments: NotificationLookupArguments): Promise<number | null>;
|
getSecondsThresholdForNotificationIfExists(lookupArguments: NotificationLookupArguments): Promise<number | null>;
|
||||||
isNotificationScheduled(lookupArguments: NotificationLookupArguments): Promise<boolean>;
|
isNotificationScheduled(lookupArguments: NotificationLookupArguments): Promise<boolean>;
|
||||||
addOrUpdateNotification(notification: ScheduledNotification): Promise<void>;
|
addOrUpdateNotification(notification: ScheduledNotification): Promise<void>;
|
||||||
deleteNotificationIfExists(lookupArguments: NotificationLookupArguments): Promise<void>;
|
deleteNotificationIfExists(lookupArguments: NotificationLookupArguments): Promise<void>;
|
||||||
|
|
||||||
|
subscribeToNotificationChanges(listener: (event: NotificationEvent) => any): void;
|
||||||
|
unsubscribeFromNotificationChanges(listener: (event: NotificationEvent) => any): void;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user