add another build method for use in development/production

This commit is contained in:
2025-04-07 12:50:49 -07:00
parent 96d4acb762
commit 554898b097

View File

@@ -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(