module cleanup

This commit is contained in:
2025-12-19 01:22:45 +01:00
parent d617654928
commit d0fac9e6c1
135 changed files with 5104 additions and 1315 deletions

View File

@@ -0,0 +1,12 @@
import type { PageView } from '../entities/PageView';
export interface IPageViewRepository {
save(pageView: PageView): Promise<void>;
findById(id: string): Promise<PageView | null>;
findByEntityId(entityId: string): Promise<PageView[]>;
findBySessionId(sessionId: string): Promise<PageView[]>;
countByEntityId(entityId: string): Promise<number>;
getUniqueVisitorsCount(entityId: string, startDate: Date, endDate: Date): Promise<number>;
getAverageSessionDuration(entityId: string, startDate: Date, endDate: Date): Promise<number>;
getBounceRate(entityId: string, startDate: Date, endDate: Date): Promise<number>;
}

View File

@@ -5,24 +5,30 @@
* Kept in domain/types so domain/entities contains only entity classes.
*/
export type EngagementAction =
| 'click_sponsor_logo'
| 'click_sponsor_url'
| 'download_livery_pack'
| 'join_league'
| 'register_race'
| 'view_standings'
| 'view_schedule'
| 'share_social'
| 'contact_sponsor';
export const EngagementAction = {
CLICK_SPONSOR_LOGO: 'click_sponsor_logo',
CLICK_SPONSOR_URL: 'click_sponsor_url',
DOWNLOAD_LIVERY_PACK: 'download_livery_pack',
JOIN_LEAGUE: 'join_league',
REGISTER_RACE: 'register_race',
VIEW_STANDINGS: 'view_standings',
VIEW_SCHEDULE: 'view_schedule',
SHARE_SOCIAL: 'share_social',
CONTACT_SPONSOR: 'contact_sponsor',
} as const;
export type EngagementEntityType =
| 'league'
| 'driver'
| 'team'
| 'race'
| 'sponsor'
| 'sponsorship';
export type EngagementAction = typeof EngagementAction[keyof typeof EngagementAction];
export const EngagementEntityType = {
LEAGUE: 'league',
DRIVER: 'driver',
TEAM: 'team',
RACE: 'race',
SPONSOR: 'sponsor',
SPONSORSHIP: 'sponsorship',
} as const;
export type EngagementEntityType = typeof EngagementEntityType[keyof typeof EngagementEntityType];
export interface EngagementEventProps {
id: string;

View File

@@ -5,19 +5,23 @@
* Kept in domain/types so domain/entities contains only entity classes.
*/
export enum EntityType {
LEAGUE = 'league',
DRIVER = 'driver',
TEAM = 'team',
RACE = 'race',
SPONSOR = 'sponsor',
}
export const EntityType = {
LEAGUE: 'league',
DRIVER: 'driver',
TEAM: 'team',
RACE: 'race',
SPONSOR: 'sponsor',
} as const;
export enum VisitorType {
ANONYMOUS = 'anonymous',
DRIVER = 'driver',
SPONSOR = 'sponsor',
}
export type EntityType = typeof EntityType[keyof typeof EntityType];
export const VisitorType = {
ANONYMOUS: 'anonymous',
DRIVER: 'driver',
SPONSOR: 'sponsor',
} as const;
export type VisitorType = typeof VisitorType[keyof typeof VisitorType];
export interface PageViewProps {
id: string;