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.
func SelectBestWithLogging ¶ added in v1.3.3
func SelectBestWithLogging( aiScores map[uuid.UUID]int, candidates []Candidate, lastByTea map[uuid.UUID]time.Time, now time.Time, logf LogFunc, ) (uuid.UUID, int)
SelectBestWithLogging selects the best tea and emits detailed logs via the provided logf callback. If logf is nil, no logs are emitted. It preserves the same scoring rules as SelectBest and returns the chosen tea ID 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.