📦 Package Quick Mode - Test Page

✅ Test Scenarios

Krok 1: Base Session Price

  • Zadej base price (např. 2600 Kč)
  • Ověř, že se aktualizuje preview

Krok 2: Package Tiers

  • Ověř 3 defaultní tiers (Starter/Pro/Premium)
  • Zkontroluj slevy (5%, 10%, 15%)
  • Toggle enable/disable jednotlivých tiers
  • Ověř ceny per session

Krok 3: Early Bird Bonus

  • Toggle Early Bird checkbox
  • Vyberi slevu (3%, 5%, 7%)
  • Ověř threshold 21 dní
  • Freemium: zobrazit FreemiumLock

Krok 4: Velocity Limit

  • Posunout slider (10-30%)
  • Ověř příklad výpočtu
  • Zkontroluj helper text
🎯 Expected Results

Package Tier Calculation

  • Base: 2600 Kč
  • Starter (3 sessions, -5%): 7 410 Kč (2 470 Kč/session)
  • Pro (5 sessions, -10%): 11 700 Kč (2 340 Kč/session)
  • Premium (10 sessions, -15%): 22 100 Kč (2 210 Kč/session)

Velocity Limit Example

  • Pro balíček: 11 700 Kč
  • Velocity ±20%: max 14 040 Kč, min 9 360 Kč

Console Output

  • Check console for "Saving offering" log
  • Verify PricingRules structure
  • Check packageVelocity config
🚀 Spustit Package Wizard →← Phase 0 Test Page
🧪 Unit Tests

Run unit tests for velocity limits:

npx vitest run __tests__/unit/lib/pricing-package.test.ts

Expected output:

  • ✅ should return raw price when velocity is disabled
  • ✅ should return raw price when no price history exists
  • ✅ should cap price increase if exceeds daily limit (+20%)
  • ✅ should cap price decrease if exceeds daily limit (-20%)
  • ✅ should not cap if price change is within daily limit
  • ✅ should include velocity metadata in result
  • ✅ should handle package discount correctly
📋 Next: Phase 2.2 - Velocity Integration

Po úspěšném testu wizardu:

  1. Integrate calculatePackagePriceWithVelocity() do API endpoints
  2. Hook up package-price-history DB wrappers
  3. Test E2E: Create package → check price history table
  4. Verify velocity limit enforcement over 3 days