package generation import ( "github.com/tradarr/backend/internal/models" "regexp" "strings" ) var yahooTicker = regexp.MustCompile(`^[A-Za-z0-9^][A-Za-z0-9.^=\-]{0,31}$`) var figiIdentity = regexp.MustCompile(`^BBG[A-Z0-9]{9}$`) // Only the Yahoo source gets the catalogue's Yahoo listing hint. Other feeds // retain the exact historical Symbol input. No guesses or Bloomberg conversion. func yahooSymbols(assets []models.UserAsset) []string { out := []string{} seen := map[string]bool{} for _, a := range assets { symbol := a.Symbol if a.CompanyID != nil { if a.YahooSymbol == nil { continue } symbol = *a.YahooSymbol } if !yahooTicker.MatchString(symbol) || figiIdentity.MatchString(strings.ToUpper(symbol)) || seen[symbol] { continue } seen[symbol] = true out = append(out, symbol) } return out }