Files
gridpilot.gg/packages/analytics/domain/repositories/IAnalyticsSnapshotRepository.ts
2025-12-10 12:38:55 +01:00

27 lines
967 B
TypeScript

/**
* Repository Interface: IAnalyticsSnapshotRepository
*
* Defines persistence operations for AnalyticsSnapshot entities.
*/
import type { AnalyticsSnapshot, SnapshotPeriod, SnapshotEntityType } from '../entities/AnalyticsSnapshot';
export interface IAnalyticsSnapshotRepository {
save(snapshot: AnalyticsSnapshot): Promise<void>;
findById(id: string): Promise<AnalyticsSnapshot | null>;
findByEntity(entityType: SnapshotEntityType, entityId: string): Promise<AnalyticsSnapshot[]>;
findByPeriod(
entityType: SnapshotEntityType,
entityId: string,
period: SnapshotPeriod,
startDate: Date,
endDate: Date
): Promise<AnalyticsSnapshot | null>;
findLatest(entityType: SnapshotEntityType, entityId: string, period: SnapshotPeriod): Promise<AnalyticsSnapshot | null>;
getHistoricalSnapshots(
entityType: SnapshotEntityType,
entityId: string,
period: SnapshotPeriod,
limit: number
): Promise<AnalyticsSnapshot[]>;
}