17 lines
713 B
TypeScript
17 lines
713 B
TypeScript
/**
|
|
* Repository Interface: IPageViewRepository
|
|
*
|
|
* Defines persistence operations for PageView entities.
|
|
*/
|
|
|
|
import type { PageView, EntityType } from '../entities/PageView';
|
|
|
|
export interface IPageViewRepository {
|
|
save(pageView: PageView): Promise<void>;
|
|
findById(id: string): Promise<PageView | null>;
|
|
findByEntityId(entityType: EntityType, entityId: string): Promise<PageView[]>;
|
|
findByDateRange(startDate: Date, endDate: Date): Promise<PageView[]>;
|
|
findBySession(sessionId: string): Promise<PageView[]>;
|
|
countByEntityId(entityType: EntityType, entityId: string, since?: Date): Promise<number>;
|
|
countUniqueVisitors(entityType: EntityType, entityId: string, since?: Date): Promise<number>;
|
|
} |