mirror of
https://github.com/SamyRai/tercul-backend.git
synced 2025-12-27 00:31:35 +00:00
This commit introduces analytics features to the application. It includes: - Extended domain models for storing analytics data. - An analytics repository and service for managing the data. - Integration with GraphQL mutations to update analytics counts. - New GraphQL queries to expose analytics data. - Unit and integration tests for the new features.
19 lines
925 B
Go
19 lines
925 B
Go
package domain
|
|
|
|
import "context"
|
|
|
|
type AnalyticsRepository interface {
|
|
IncrementWorkViews(ctx context.Context, workID uint) error
|
|
IncrementWorkLikes(ctx context.Context, workID uint) error
|
|
IncrementWorkComments(ctx context.Context, workID uint) error
|
|
IncrementWorkBookmarks(ctx context.Context, workID uint) error
|
|
IncrementWorkShares(ctx context.Context, workID uint) error
|
|
IncrementWorkTranslationCount(ctx context.Context, workID uint) error
|
|
IncrementTranslationViews(ctx context.Context, translationID uint) error
|
|
IncrementTranslationLikes(ctx context.Context, translationID uint) error
|
|
IncrementTranslationComments(ctx context.Context, translationID uint) error
|
|
IncrementTranslationShares(ctx context.Context, translationID uint) error
|
|
GetOrCreateWorkStats(ctx context.Context, workID uint) (*WorkStats, error)
|
|
GetOrCreateTranslationStats(ctx context.Context, translationID uint) (*TranslationStats, error)
|
|
}
|