package leaderboard import ( "context" sharedtypes "knowfoolery/backend/shared/domain/types" ) // TopFilter narrows leaderboard list/stat queries. type TopFilter struct { CompletionType string Window Window } // Repository defines leaderboard persistence behavior. type Repository interface { EnsureSchema(ctx context.Context) error IngestEntry(ctx context.Context, entry *LeaderboardEntry) (*LeaderboardEntry, bool, error) ListTop(ctx context.Context, filter TopFilter, limit int) ([]*LeaderboardEntry, error) GetPlayerStats(ctx context.Context, playerID string) (*PlayerStats, error) GetPlayerRank(ctx context.Context, playerID string) (int64, error) ListPlayerHistory( ctx context.Context, playerID string, pagination sharedtypes.Pagination, ) ([]*LeaderboardEntry, int64, error) GetGlobalStats(ctx context.Context, filter TopFilter) (*GlobalStats, error) }