import { TelemetryEvent } from '../entities/telemetry-event.entity';

export const TELEMETRY_EVENT_REPOSITORY = Symbol('TELEMETRY_EVENT_REPOSITORY');

export interface DauBreakdown {
  key: string;
  count: number;
}

export interface EventListFilters {
  eventName?: string;
  userId?: string;
  page: number;
  limit: number;
}

export interface ITelemetryEventRepository {
  saveBatch(events: TelemetryEvent[]): Promise<void>;
  getDauCount(startTime: Date, endTime: Date): Promise<number>;
  getDauByPlatform(startTime: Date, endTime: Date): Promise<DauBreakdown[]>;
  getDauByRegion(startTime: Date, endTime: Date): Promise<DauBreakdown[]>;
  findPaginated(filters: EventListFilters): Promise<[TelemetryEvent[], number]>;
  countSince(since: Date): Promise<number>;
}
