Skip to content

Get Product Substitution Suggestions

As a Host, I want to receive intelligent suggestions for alternative products, So that I can find suitable substitutes when items are low or out of stock.

  • Given a product is low or out of stock
  • When I view the product detail screen
  • Then the system automatically shows suggested substitutes
  • And suggestions are prioritized by:
    • Critical priority: Out of stock products (red, exclamation icon)
    • High priority: Low stock products (orange, warning icon)
    • Normal priority: General alternatives (blue, lightbulb icon)
  • And each suggestion shows:
    • Match score (0-100%) with color-coded badge:
      • Green: 80% or higher match (excellent)
      • Yellow: 60% or higher match (good)
      • Gray: Less than 60% match (acceptable)
    • Match reason explanation (e.g., “Same ingredient: Vodka, Similar flavor profile”)
    • Product name and brand
    • Current inventory level with visual indicator
    • Price comparison with original product (difference shown)
    • Availability status (in stock, low stock, out of stock)
  • And the matching algorithm considers:
    • Same ingredient mapping (highest priority - both products map to same ingredient)
    • Similar flavor profiles (based on flavor characteristics)
    • Similar price ranges (within 20% = very similar, within 50% = somewhat similar)
    • Current availability (in stock products preferred)
  • And I can tap a suggestion to navigate to that product’s detail screen
  • And suggestions are limited to meaningful matches (minimum 50% match score)

✅ IMPLEMENTED (December 2025)

Files Created:

  • shaker/utils/productSubstitutions.ts - Substitution matching logic
  • shaker/components/SubstitutionSuggestions.tsx - Display component

Files Modified:

  • shaker/app/(tabs)/inventory/products/[id].tsx - Added substitution display
  • shaker/components/index.ts - Exported SubstitutionSuggestions

Matching Algorithm:

  • Same ingredient mapping: +50 points
  • Flavor profile similarity: +0-30 points
  • Price similarity: +0-15 points
  • Availability: +0-5 points
  • Minimum match score: 50 points

Features:

  • Automatic calculation when product is low/out of stock
  • Priority-based display (critical/high/normal)
  • Match score with color-coded badges
  • Clear match reason explanations
  • Price comparison with original
  • Navigation to substitute product details

See: Substitution Suggestions Implementation for complete details.

High - Helps prevent stockouts and maintain bar quality

  • Product, Ingredient, FlavorProfile
  • User preference learning (track what substitutes work well)
  • Brand loyalty preferences (prefer same brand substitutes)
  • Recipe impact display (show which recipes are affected)
  • One-tap add substitute to shopping list
  • Substitution history tracking (what worked well)
  • Custom substitution rules (user-defined preferences)
  • Multi-product substitution suggestions
  • Seasonal availability considerations