mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
extract notification repository to interface
This commit is contained in:
19
src/repositories/InMemoryNotificationRepository.ts
Normal file
19
src/repositories/InMemoryNotificationRepository.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { NotificationLookupArguments, NotificationRepository, ScheduledNotification } from "./NotificationRepository";
|
||||
|
||||
export class InMemoryNotificationRepository implements NotificationRepository {
|
||||
async getAllNotificationsForShuttleAndStopId(shuttleId: string, stopId: string) {
|
||||
return [];
|
||||
}
|
||||
|
||||
async getSecondsThresholdForNotificationIfExists(lookupArguments: NotificationLookupArguments) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
async addOrUpdateNotification(notification: ScheduledNotification) {
|
||||
|
||||
}
|
||||
|
||||
async deleteNotificationIfExists(lookupArguments: NotificationLookupArguments) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -14,20 +14,9 @@ export interface ScheduledNotification extends NotificationLookupArguments {
|
||||
secondsThreshold: number;
|
||||
}
|
||||
|
||||
export class NotificationRepository {
|
||||
public async getAllNotificationsForShuttleAndStopId(shuttleId: string, stopId: string) {
|
||||
|
||||
}
|
||||
|
||||
public async getSecondsThresholdForNotificationIfExists(lookupArguments: NotificationLookupArguments) {
|
||||
|
||||
}
|
||||
|
||||
public async addOrUpdateNotification(notification: ScheduledNotification) {
|
||||
|
||||
}
|
||||
|
||||
public async deleteNotificationIfExists(lookupArguments: NotificationLookupArguments) {
|
||||
|
||||
}
|
||||
export interface NotificationRepository {
|
||||
getAllNotificationsForShuttleAndStopId(shuttleId: string, stopId: string): Promise<ScheduledNotification[]>;
|
||||
getSecondsThresholdForNotificationIfExists(lookupArguments: NotificationLookupArguments): Promise<number>;
|
||||
addOrUpdateNotification(notification: ScheduledNotification): Promise<void>;
|
||||
deleteNotificationIfExists(lookupArguments: NotificationLookupArguments): Promise<void>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user