mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
add notification event subscriber/unsubscriber
This commit is contained in:
@@ -14,10 +14,18 @@ export interface ScheduledNotification extends NotificationLookupArguments {
|
||||
secondsThreshold: number;
|
||||
}
|
||||
|
||||
export interface NotificationEvent {
|
||||
notification: ScheduledNotification,
|
||||
event: 'delete' | 'addOrUpdate'
|
||||
}
|
||||
|
||||
export interface NotificationRepository {
|
||||
getAllNotificationsForShuttleAndStopId(shuttleId: string, stopId: string): Promise<ScheduledNotification[]>;
|
||||
getSecondsThresholdForNotificationIfExists(lookupArguments: NotificationLookupArguments): Promise<number | null>;
|
||||
isNotificationScheduled(lookupArguments: NotificationLookupArguments): Promise<boolean>;
|
||||
addOrUpdateNotification(notification: ScheduledNotification): 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