mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
add another build method for use in development/production
This commit is contained in:
@@ -35,7 +35,36 @@ export class InterchangeSystem {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct an instance of the class where all composited
|
* 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
|
* @param args
|
||||||
*/
|
*/
|
||||||
static buildForTesting(
|
static buildForTesting(
|
||||||
|
|||||||
Reference in New Issue
Block a user