27 lines
967 B
TypeScript
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[]>;
|
|
} |