tercul-backend/internal/domain/analytics.go
google-labs-jules[bot] 4c2f20c33d feat: Implement blog schema and example content
This commit introduces a new blog feature by implementing a JSON schema for blog posts and providing five example content files.

Key changes:
- Created a new directory structure for schemas and content (`schemas/`, `content/blog/`).
- Implemented a JSON schema for blog posts, split into `blog.json` and `_defs.json` for reusability.
- Added five example blog post files with full, realistic content.
- Included a Python script (`validate.py`) to validate the example content against the schema.
2025-09-07 23:22:36 +00:00

19 lines
976 B
Go

package domain
import "context"
import "time"
type AnalyticsRepository 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 WorkStats) error
UpdateTranslationStats(ctx context.Context, translationID uint, stats TranslationStats) error
GetOrCreateWorkStats(ctx context.Context, workID uint) (*WorkStats, error)
GetOrCreateTranslationStats(ctx context.Context, translationID uint) (*TranslationStats, error)
GetOrCreateUserEngagement(ctx context.Context, userID uint, date time.Time) (*UserEngagement, error)
UpdateUserEngagement(ctx context.Context, userEngagement *UserEngagement) error
UpdateTrendingWorks(ctx context.Context, timePeriod string, trending []*Trending) error
GetTrendingWorks(ctx context.Context, timePeriod string, limit int) ([]*Work, error)
}