scoring

package
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SelectBest

func SelectBest(
	aiScores map[uuid.UUID]int,
	candidates []Candidate,
	lastByTea map[uuid.UUID]time.Time,
	now time.Time,
) (uuid.UUID, int)

SelectBest selects the best tea according to the scoring rules. Inputs: - aiScores: context-aware scores (0..15) provided by AI per tea ID (weather + day-of-week) - candidates: list of candidates with expiration/name - lastByTea: most recent consumption time per tea ID - now: current time Returns the ID of the best tea and its total score.

Types

type Candidate

type Candidate struct {
	ID         uuid.UUID
	Name       string
	Expiration time.Time // earliest expiration among user records for this tea; zero if unknown
}

Candidate represents a tea candidate for Tea of the Day selection. It intentionally contains only the fields required for scoring to avoid importing API model packages and creating cycles.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL