From 5b695c7250fdd6f7558fc7a7a8e37b0434343b19 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Sun, 6 Apr 2025 10:29:41 -0700 Subject: [PATCH] add notification repository argument --- src/entities/System.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/entities/System.ts b/src/entities/System.ts index 78857e1..d4737c5 100644 --- a/src/entities/System.ts +++ b/src/entities/System.ts @@ -3,6 +3,7 @@ import { ETANotificationScheduler } from "../notifications/schedulers/ETANotific import { TimedApiBasedShuttleRepositoryLoader } from "../loaders/TimedApiBasedShuttleRepositoryLoader"; import { UnoptimizedInMemoryShuttleRepository } from "../repositories/UnoptimizedInMemoryShuttleRepository"; import { RedisNotificationRepository } from "../repositories/RedisNotificationRepository"; +import { NotificationRepository } from "../repositories/NotificationRepository"; export class System { constructor( @@ -16,12 +17,15 @@ export class System { * Construct an instance of the class where all composited * classes are correctly linked. * @param systemId + * @param notificationRepository */ - static build(systemId: string) { + static build( + systemId: string, + notificationRepository: NotificationRepository = new RedisNotificationRepository() + ) { const shuttleRepository = new UnoptimizedInMemoryShuttleRepository(); const shuttleDataLoader = new TimedApiBasedShuttleRepositoryLoader(systemId, shuttleRepository); - const notificationRepository = new RedisNotificationRepository(); const notificationScheduler = new ETANotificationScheduler(shuttleRepository, notificationRepository); const system = new System(