Renamed components of member-analytic-service

no-issue

This removes the concept of "Module" which simplifies the code
This commit is contained in:
Fabien O'Carroll 2021-09-21 13:33:38 +02:00
parent 216d27371a
commit ed6d305fb2
2 changed files with 7 additions and 7 deletions

View File

@ -1,19 +1,19 @@
const AnalyticEventRepository = require('./lib/AnalyticEventRepository');
const AnalyticsService = require('./lib/AnalyticsService');
const EventHandler = require('./lib/EventHandler');
class MemberAnalyticsModule {
class MemberAnalyticsService {
/**
* @param {AnalyticEventRepository} analyticEventRepository
*/
constructor(analyticEventRepository) {
this.service = new AnalyticsService(analyticEventRepository);
this.eventHandler = new EventHandler(analyticEventRepository);
}
static create(AnalyticEventModel) {
const analyticEventRepository = new AnalyticEventRepository(AnalyticEventModel);
return new MemberAnalyticsModule(analyticEventRepository);
return new MemberAnalyticsService(analyticEventRepository);
}
}
module.exports = MemberAnalyticsModule;
module.exports = MemberAnalyticsService;

View File

@ -3,7 +3,7 @@ const {MemberEntryViewEvent} = require('@tryghost/member-events');
const AnalyticEvent = require('./AnalyticEvent');
class AnalyticsService {
class EventHandler {
/**
* @param {import('./AnalyticEventRepository')} repository
*/
@ -31,4 +31,4 @@ class AnalyticsService {
}
}
module.exports = AnalyticsService;
module.exports = EventHandler;