diff --git a/src/entities/InterchangeSystem.ts b/src/entities/InterchangeSystem.ts index 4db31a6..b21a2ba 100644 --- a/src/entities/InterchangeSystem.ts +++ b/src/entities/InterchangeSystem.ts @@ -35,7 +35,36 @@ export class InterchangeSystem { /** * Construct an instance of the class where all composited - * classes are correctly linked. + * classes are correctly linked, meant for use in development and production. + * @param args + */ + static build( + args: InterchangeSystemBuilderArguments, + ) { + const shuttleRepository = new UnoptimizedInMemoryShuttleRepository(); + const shuttleDataLoader = new TimedApiBasedShuttleRepositoryLoader(args.passioSystemId, shuttleRepository); + + const notificationRepository = new RedisNotificationRepository(); + const notificationScheduler = new ETANotificationScheduler( + shuttleRepository, + notificationRepository, + new AppleNotificationSender(), + ); + + return new InterchangeSystem( + args.name, + args.id, + shuttleDataLoader, + shuttleRepository, + notificationScheduler, + notificationRepository, + ); + } + + /** + * Construct an instance of the class where all composited + * classes are correctly linked, meant for unit tests, and server/app + * integration tests. * @param args */ static buildForTesting(