package work import ( "context" "tercul/internal/domain" ) type mockAnalyticsService struct { updateWorkReadingTimeFunc func(ctx context.Context, workID uint) error updateWorkComplexityFunc func(ctx context.Context, workID uint) error updateWorkSentimentFunc func(ctx context.Context, workID uint) error updateTranslationReadingTimeFunc func(ctx context.Context, translationID uint) error updateTranslationSentimentFunc func(ctx context.Context, translationID uint) error getOrCreateWorkStatsFunc func(ctx context.Context, workID uint) (*domain.WorkStats, error) updateWorkStatsFunc func(ctx context.Context, workID uint, stats domain.WorkStats) error } func (m *mockAnalyticsService) UpdateWorkStats(ctx context.Context, workID uint, stats domain.WorkStats) error { if m.updateWorkStatsFunc != nil { return m.updateWorkStatsFunc(ctx, workID, stats) } return nil } func (m *mockAnalyticsService) UpdateWorkReadingTime(ctx context.Context, workID uint) error { if m.updateWorkReadingTimeFunc != nil { return m.updateWorkReadingTimeFunc(ctx, workID) } return nil } func (m *mockAnalyticsService) UpdateWorkComplexity(ctx context.Context, workID uint) error { if m.updateWorkComplexityFunc != nil { return m.updateWorkComplexityFunc(ctx, workID) } return nil } func (m *mockAnalyticsService) UpdateWorkSentiment(ctx context.Context, workID uint) error { if m.updateWorkSentimentFunc != nil { return m.updateWorkSentimentFunc(ctx, workID) } return nil } func (m *mockAnalyticsService) UpdateTranslationReadingTime(ctx context.Context, translationID uint) error { if m.updateTranslationReadingTimeFunc != nil { return m.updateTranslationReadingTimeFunc(ctx, translationID) } return nil } func (m *mockAnalyticsService) UpdateTranslationSentiment(ctx context.Context, translationID uint) error { if m.updateTranslationSentimentFunc != nil { return m.updateTranslationSentimentFunc(ctx, translationID) } return nil } // Implement other methods of the analytics.Service interface to satisfy the compiler func (m *mockAnalyticsService) IncrementWorkViews(ctx context.Context, workID uint) error { return nil } func (m *mockAnalyticsService) IncrementWorkLikes(ctx context.Context, workID uint) error { return nil } func (m *mockAnalyticsService) IncrementWorkComments(ctx context.Context, workID uint) error { return nil } func (m *mockAnalyticsService) IncrementWorkBookmarks(ctx context.Context, workID uint) error { return nil } func (m *mockAnalyticsService) IncrementWorkShares(ctx context.Context, workID uint) error { return nil } func (m *mockAnalyticsService) IncrementWorkTranslationCount(ctx context.Context, workID uint) error { return nil } func (m *mockAnalyticsService) IncrementTranslationViews(ctx context.Context, translationID uint) error { return nil } func (m *mockAnalyticsService) IncrementTranslationLikes(ctx context.Context, translationID uint) error { return nil } func (m *mockAnalyticsService) DecrementWorkLikes(ctx context.Context, workID uint) error { return nil } func (m *mockAnalyticsService) DecrementTranslationLikes(ctx context.Context, translationID uint) error { return nil } func (m *mockAnalyticsService) IncrementTranslationComments(ctx context.Context, translationID uint) error { return nil } func (m *mockAnalyticsService) IncrementTranslationShares(ctx context.Context, translationID uint) error { return nil } func (m *mockAnalyticsService) GetOrCreateWorkStats(ctx context.Context, workID uint) (*domain.WorkStats, error) { if m.getOrCreateWorkStatsFunc != nil { return m.getOrCreateWorkStatsFunc(ctx, workID) } return nil, nil } func (m *mockAnalyticsService) GetOrCreateTranslationStats(ctx context.Context, translationID uint) (*domain.TranslationStats, error) { return nil, nil } func (m *mockAnalyticsService) UpdateUserEngagement(ctx context.Context, userID uint, eventType string) error { return nil } func (m *mockAnalyticsService) UpdateTrending(ctx context.Context) error { return nil } func (m *mockAnalyticsService) GetTrendingWorks(ctx context.Context, timePeriod string, limit int) ([]*domain.Work, error) { return nil, nil }