2021-09-21 12:25:45 +03:00
|
|
|
const AnalyticEventRepository = require('./lib/AnalyticEventRepository');
|
2021-09-21 14:33:38 +03:00
|
|
|
const EventHandler = require('./lib/EventHandler');
|
2021-09-21 12:25:45 +03:00
|
|
|
|
2021-09-21 14:33:38 +03:00
|
|
|
class MemberAnalyticsService {
|
2021-09-21 12:25:45 +03:00
|
|
|
/**
|
|
|
|
* @param {AnalyticEventRepository} analyticEventRepository
|
|
|
|
*/
|
|
|
|
constructor(analyticEventRepository) {
|
2021-09-21 14:33:38 +03:00
|
|
|
this.eventHandler = new EventHandler(analyticEventRepository);
|
2021-09-21 12:25:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static create(AnalyticEventModel) {
|
|
|
|
const analyticEventRepository = new AnalyticEventRepository(AnalyticEventModel);
|
|
|
|
|
2021-09-21 14:33:38 +03:00
|
|
|
return new MemberAnalyticsService(analyticEventRepository);
|
2021-09-21 12:25:45 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-21 14:33:38 +03:00
|
|
|
module.exports = MemberAnalyticsService;
|