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.
Acceptance Criteria
Section titled âAcceptance Criteriaâ- 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)
- Match score (0-100%) with color-coded badge:
- 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)
Implementation Status
Section titled âImplementation Statusââ IMPLEMENTED (December 2025)
Implementation Details
Section titled âImplementation DetailsâFiles Created:
shaker/utils/productSubstitutions.ts- Substitution matching logicshaker/components/SubstitutionSuggestions.tsx- Display component
Files Modified:
shaker/app/(tabs)/inventory/products/[id].tsx- Added substitution displayshaker/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.
Priority
Section titled âPriorityâHigh - Helps prevent stockouts and maintain bar quality
Related Entities
Section titled âRelated Entitiesâ- Product, Ingredient, FlavorProfile
Future Enhancements
Section titled âFuture Enhancementsâ- 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