-- Taste profile: aggregated user preferences computed from behavior
CREATE TABLE IF NOT EXISTS user_taste_profile (
  user_id UUID PRIMARY KEY REFERENCES users(id) ON DELETE CASCADE,
  preferred_brands JSONB DEFAULT '[]',       -- [{slug, name, score}]
  preferred_price_range JSONB DEFAULT '{}',  -- {min, max, avg}
  preferred_styles JSONB DEFAULT '[]',       -- [{style, score}]
  preferred_gender TEXT,
  last_computed_at TIMESTAMPTZ DEFAULT NOW()
);

CREATE INDEX IF NOT EXISTS idx_taste_profile_computed ON user_taste_profile(last_computed_at);
