module cleanup
This commit is contained in:
12
core/analytics/domain/repositories/IPageViewRepository.ts
Normal file
12
core/analytics/domain/repositories/IPageViewRepository.ts
Normal 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>;
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user