website refactor
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* Captures visitor interactions with leagues, drivers, teams, races.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import type { EntityType, PageViewProps, VisitorType } from '../types/PageView';
|
||||
import { AnalyticsEntityId } from '../value-objects/AnalyticsEntityId';
|
||||
import { AnalyticsSessionId } from '../value-objects/AnalyticsSessionId';
|
||||
@@ -13,7 +13,7 @@ import { PageViewId } from '../value-objects/PageViewId';
|
||||
|
||||
export type { EntityType, VisitorType } from '../types/PageView';
|
||||
|
||||
export class PageView implements Entity<string> {
|
||||
export class PageView extends Entity<string> {
|
||||
readonly entityType: EntityType;
|
||||
readonly visitorId: string | undefined;
|
||||
readonly visitorType: VisitorType;
|
||||
@@ -28,6 +28,7 @@ export class PageView implements Entity<string> {
|
||||
private readonly sessionIdVo: AnalyticsSessionId;
|
||||
|
||||
private constructor(props: PageViewProps) {
|
||||
super(props.id);
|
||||
this.idVo = PageViewId.create(props.id);
|
||||
this.entityType = props.entityType;
|
||||
this.entityIdVo = AnalyticsEntityId.create(props.entityId);
|
||||
@@ -41,10 +42,6 @@ export class PageView implements Entity<string> {
|
||||
this.durationMs = props.durationMs;
|
||||
}
|
||||
|
||||
get id(): string {
|
||||
return this.idVo.value;
|
||||
}
|
||||
|
||||
get entityId(): string {
|
||||
return this.entityIdVo.value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user