This commit is contained in:
2025-12-11 13:50:38 +01:00
parent e4c1be628d
commit c7e5de40d6
212 changed files with 2965 additions and 763 deletions

View File

@@ -1,15 +1,16 @@
/**
* Query: GetEntityAnalyticsQuery
*
*
* Retrieves analytics data for an entity (league, driver, team, race).
* Returns metrics formatted for display to sponsors and admins.
*/
import type { AsyncUseCase } from '@gridpilot/shared/application';
import type { IPageViewRepository } from '../../domain/repositories/IPageViewRepository';
import type { IEngagementRepository } from '../../domain/repositories/IEngagementRepository';
import type { IAnalyticsSnapshotRepository } from '../../domain/repositories/IAnalyticsSnapshotRepository';
import type { EntityType } from '../../domain/entities/PageView';
import type { SnapshotPeriod } from '../../domain/entities/AnalyticsSnapshot';
import type { EntityType } from '../../domain/types/PageView';
import type { SnapshotPeriod } from '../../domain/types/AnalyticsSnapshot';
export interface GetEntityAnalyticsInput {
entityType: EntityType;
@@ -41,7 +42,8 @@ export interface EntityAnalyticsOutput {
};
}
export class GetEntityAnalyticsQuery {
export class GetEntityAnalyticsQuery
implements AsyncUseCase<GetEntityAnalyticsInput, EntityAnalyticsOutput> {
constructor(
private readonly pageViewRepository: IPageViewRepository,
private readonly engagementRepository: IEngagementRepository,