package analytics

import (
	"context"
	"tercul/internal/domain"
	"time"
)

// AnalyticsRepository defines the data access layer for analytics.
type Repository interface {
	IncrementWorkCounter(ctx context.Context, workID uint, field string, value int) error
	IncrementTranslationCounter(ctx context.Context, translationID uint, field string, value int) error
	UpdateWorkStats(ctx context.Context, workID uint, stats domain.WorkStats) error
	UpdateTranslationStats(ctx context.Context, translationID uint, stats domain.TranslationStats) error
	GetOrCreateWorkStats(ctx context.Context, workID uint) (*domain.WorkStats, error)
	GetOrCreateTranslationStats(ctx context.Context, translationID uint) (*domain.TranslationStats, error)
	GetOrCreateUserEngagement(ctx context.Context, userID uint, date time.Time) (*domain.UserEngagement, error)
	UpdateUserEngagement(ctx context.Context, userEngagement *domain.UserEngagement) error
	UpdateTrendingWorks(ctx context.Context, timePeriod string, trending []*domain.Trending) error
	GetTrendingWorks(ctx context.Context, timePeriod string, limit int) ([]*domain.Work, error)
}