Improve the UI and training

This commit is contained in:
Urtzi Alfaro
2025-11-15 15:20:10 +01:00
parent c349b845a6
commit 843cd2bf5c
19 changed files with 2073 additions and 233 deletions

View File

@@ -353,6 +353,178 @@ class PlanFeatures:
)
# ============================================================================
# FEATURE DISPLAY CONFIGURATION (User-Facing)
# ============================================================================
class FeatureCategories:
"""User-friendly feature categorization for pricing display"""
CATEGORIES = {
"daily_operations": {
"icon": "🏪",
"translation_key": "categories.daily_operations",
},
"smart_forecasting": {
"icon": "🤖",
"translation_key": "categories.smart_forecasting",
},
"smart_ordering": {
"icon": "📦",
"translation_key": "categories.smart_ordering",
},
"business_insights": {
"icon": "📊",
"translation_key": "categories.business_insights",
},
"multi_location": {
"icon": "🏢",
"translation_key": "categories.multi_location",
},
"integrations": {
"icon": "🔌",
"translation_key": "categories.integrations",
},
"support": {
"icon": "👥",
"translation_key": "categories.support",
},
}
class UserFacingFeatures:
"""User-friendly feature descriptions for non-technical bakery owners"""
FEATURE_DISPLAY = {
# Daily Operations
"inventory_management": {
"translation_key": "features.inventory_management",
"tooltip_key": "features.inventory_management_tooltip",
"category": "daily_operations",
},
"sales_tracking": {
"translation_key": "features.sales_tracking",
"tooltip_key": "features.sales_tracking_tooltip",
"category": "daily_operations",
},
"basic_recipes": {
"translation_key": "features.basic_recipes",
"tooltip_key": "features.basic_recipes_tooltip",
"category": "daily_operations",
},
"production_planning": {
"translation_key": "features.production_planning",
"tooltip_key": "features.production_planning_tooltip",
"category": "daily_operations",
},
# Smart Forecasting
"basic_forecasting": {
"translation_key": "features.basic_forecasting",
"tooltip_key": "features.basic_forecasting_tooltip",
"category": "smart_forecasting",
},
"demand_prediction": {
"translation_key": "features.demand_prediction",
"category": "smart_forecasting",
},
"seasonal_patterns": {
"translation_key": "features.seasonal_patterns",
"tooltip_key": "features.seasonal_patterns_tooltip",
"category": "smart_forecasting",
},
"weather_data_integration": {
"translation_key": "features.weather_data_integration",
"tooltip_key": "features.weather_data_integration_tooltip",
"category": "smart_forecasting",
},
"traffic_data_integration": {
"translation_key": "features.traffic_data_integration",
"tooltip_key": "features.traffic_data_integration_tooltip",
"category": "smart_forecasting",
},
# Smart Ordering
"supplier_management": {
"translation_key": "features.supplier_management",
"tooltip_key": "features.supplier_management_tooltip",
"category": "smart_ordering",
},
"waste_tracking": {
"translation_key": "features.waste_tracking",
"tooltip_key": "features.waste_tracking_tooltip",
"category": "smart_ordering",
},
"expiry_alerts": {
"translation_key": "features.expiry_alerts",
"tooltip_key": "features.expiry_alerts_tooltip",
"category": "smart_ordering",
},
# Business Insights
"basic_reporting": {
"translation_key": "features.basic_reporting",
"category": "business_insights",
},
"advanced_analytics": {
"translation_key": "features.advanced_analytics",
"tooltip_key": "features.advanced_analytics_tooltip",
"category": "business_insights",
},
"profitability_analysis": {
"translation_key": "features.profitability_analysis",
"category": "business_insights",
},
# Multi-Location
"multi_location_support": {
"translation_key": "features.multi_location_support",
"category": "multi_location",
},
"inventory_transfer": {
"translation_key": "features.inventory_transfer",
"category": "multi_location",
},
"location_comparison": {
"translation_key": "features.location_comparison",
"category": "multi_location",
},
# Integrations
"pos_integration": {
"translation_key": "features.pos_integration",
"tooltip_key": "features.pos_integration_tooltip",
"category": "integrations",
},
"accounting_export": {
"translation_key": "features.accounting_export",
"category": "integrations",
},
"full_api_access": {
"translation_key": "features.full_api_access",
"category": "integrations",
},
# Support
"email_support": {
"translation_key": "features.email_support",
"category": "support",
},
"phone_support": {
"translation_key": "features.phone_support",
"category": "support",
},
"dedicated_account_manager": {
"translation_key": "features.dedicated_account_manager",
"category": "support",
},
"24_7_support": {
"translation_key": "features.support_24_7",
"category": "support",
},
}
# ============================================================================
# SUBSCRIPTION PLAN METADATA
# ============================================================================
@@ -363,57 +535,126 @@ class SubscriptionPlanMetadata:
PLANS = {
SubscriptionTier.STARTER: {
"name": "Starter",
"description": "Perfect for small bakeries getting started",
"tagline": "Essential tools for small operations",
"description_key": "plans.starter.description",
"tagline_key": "plans.starter.tagline",
"popular": False,
"monthly_price": PlanPricing.MONTHLY_PRICES[SubscriptionTier.STARTER],
"yearly_price": PlanPricing.YEARLY_PRICES[SubscriptionTier.STARTER],
"trial_days": 14,
"features": PlanFeatures.STARTER_FEATURES,
# Hero features (displayed prominently)
"hero_features": [
"inventory_management",
"basic_forecasting",
"supplier_management",
"waste_tracking",
],
# ROI & Business Value
"roi_badge": {
"savings_min": 300,
"savings_max": 500,
"currency": "EUR",
"period": "month",
"translation_key": "plans.starter.roi_badge",
},
"business_metrics": {
"waste_reduction": "20-30%",
"time_saved_hours_week": "5-8",
"stockout_reduction": "85-95%",
},
"limits": {
"users": QuotaLimits.MAX_USERS[SubscriptionTier.STARTER],
"locations": QuotaLimits.MAX_LOCATIONS[SubscriptionTier.STARTER],
"products": QuotaLimits.MAX_PRODUCTS[SubscriptionTier.STARTER],
"forecasts_per_day": QuotaLimits.FORECAST_GENERATION_PER_DAY[SubscriptionTier.STARTER],
"forecast_horizon_days": QuotaLimits.FORECAST_HORIZON_DAYS[SubscriptionTier.STARTER],
},
"support": "Email support (48h response)",
"recommended_for": "Single location, up to 5 team members",
"support_key": "plans.starter.support",
"recommended_for_key": "plans.starter.recommended_for",
},
SubscriptionTier.PROFESSIONAL: {
"name": "Professional",
"description": "For growing bakeries with multiple locations",
"tagline": "Advanced features & analytics",
"description_key": "plans.professional.description",
"tagline_key": "plans.professional.tagline",
"popular": True, # Most popular plan
"monthly_price": PlanPricing.MONTHLY_PRICES[SubscriptionTier.PROFESSIONAL],
"yearly_price": PlanPricing.YEARLY_PRICES[SubscriptionTier.PROFESSIONAL],
"trial_days": 14,
"features": PlanFeatures.PROFESSIONAL_FEATURES,
# Hero features (displayed prominently)
"hero_features": [
"weather_data_integration",
"multi_location_support",
"advanced_analytics",
"phone_support",
],
# ROI & Business Value
"roi_badge": {
"savings_min": 800,
"savings_max": 1200,
"currency": "EUR",
"period": "month",
"translation_key": "plans.professional.roi_badge",
},
"business_metrics": {
"waste_reduction": "30-40%",
"time_saved_hours_week": "11-17",
"procurement_cost_savings": "5-15%",
},
"limits": {
"users": QuotaLimits.MAX_USERS[SubscriptionTier.PROFESSIONAL],
"locations": QuotaLimits.MAX_LOCATIONS[SubscriptionTier.PROFESSIONAL],
"products": QuotaLimits.MAX_PRODUCTS[SubscriptionTier.PROFESSIONAL],
"forecasts_per_day": QuotaLimits.FORECAST_GENERATION_PER_DAY[SubscriptionTier.PROFESSIONAL],
"forecast_horizon_days": QuotaLimits.FORECAST_HORIZON_DAYS[SubscriptionTier.PROFESSIONAL],
},
"support": "Priority email + phone support (24h response)",
"recommended_for": "Multi-location operations, up to 20 team members",
"support_key": "plans.professional.support",
"recommended_for_key": "plans.professional.recommended_for",
},
SubscriptionTier.ENTERPRISE: {
"name": "Enterprise",
"description": "For large bakery chains and franchises",
"tagline": "Unlimited scale & custom solutions",
"description_key": "plans.enterprise.description",
"tagline_key": "plans.enterprise.tagline",
"popular": False,
"monthly_price": PlanPricing.MONTHLY_PRICES[SubscriptionTier.ENTERPRISE],
"yearly_price": PlanPricing.YEARLY_PRICES[SubscriptionTier.ENTERPRISE],
"trial_days": 30,
"features": PlanFeatures.ENTERPRISE_FEATURES,
# Hero features (displayed prominently)
"hero_features": [
"full_api_access",
"custom_algorithms",
"dedicated_account_manager",
"24_7_support",
],
# ROI & Business Value
"roi_badge": {
"translation_key": "plans.enterprise.roi_badge",
"custom": True,
},
"business_metrics": {
"waste_reduction": "Custom",
"time_saved_hours_week": "Custom",
"scale": "Unlimited",
},
"limits": {
"users": "Unlimited",
"locations": "Unlimited",
"products": "Unlimited",
"forecasts_per_day": "Unlimited",
"forecast_horizon_days": QuotaLimits.FORECAST_HORIZON_DAYS[SubscriptionTier.ENTERPRISE],
},
"support": "24/7 dedicated support + account manager",
"recommended_for": "Enterprise operations, unlimited scale",
"support_key": "plans.enterprise.support",
"recommended_for_key": "plans.enterprise.recommended_for",
"custom_pricing": True,
"contact_sales": True,
},