2016-11-04 09:03:13 +01:00
|
|
|
'use strict';
|
2016-11-04 09:35:53 +01:00
|
|
|
|
2016-11-05 10:16:48 +01:00
|
|
|
const EventStore = require('./event-store');
|
|
|
|
const FeatureToggleStore = require('./feature-toggle-store');
|
|
|
|
const StrategyStore = require('./strategy-store');
|
2016-11-04 09:03:13 +01:00
|
|
|
const clientInstancesDbCreator = require('./client-instances');
|
|
|
|
const clientMetricsDbCreator = require('./client-metrics');
|
|
|
|
const clientStrategiesDbCreator = require('./client-strategies');
|
|
|
|
|
2016-11-05 10:16:48 +01:00
|
|
|
module.exports = (db) => {
|
|
|
|
const eventStore = new EventStore(db);
|
|
|
|
|
|
|
|
return {
|
|
|
|
eventStore,
|
|
|
|
featureToggleStore: new FeatureToggleStore(db, eventStore),
|
|
|
|
strategyStore: new StrategyStore(db, eventStore),
|
|
|
|
clientInstancesDb: clientInstancesDbCreator(db),
|
|
|
|
clientMetricsDb: clientMetricsDbCreator(db),
|
|
|
|
clientStrategiesDb: clientStrategiesDbCreator(db),
|
|
|
|
};
|
|
|
|
};
|