Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Dynamic Pricings 2.0

Note: This page documents Dynamic Pricings 2.0, the rule-based pricing system backed by the hungryhub-team/pricing-engine Rails 8 microservice. Replaces the per-package hh_package_pricings rule-array approach (see Dynamic Pricings 1.0).

Description / Background

Restaurants aim to optimise their pricing dynamically based on real-time demand, booking patterns, and historical performance. Instead of relying on static prices, Dynamic Pricings 2.0 allows partners to automatically adjust package rates using predefined rules or AI-driven insights. This enhances revenue management and ensures competitive pricing across varying market conditions. Additionally, the platform introduces a price-filter system tailored to each country’s local currency. Users can easily browse restaurants by budget tiers such as budget, mid-range, and premium casual, ensuring consistency and clarity regardless of region or exchange rate.

Glossary

Dynamic Pricings 2.0 PRD

Objectives

Owner can:

  • Create, edit, duplicate, and delete Dynamic Pricing Rules from the Partner Portal.
  • Define pricing configurations, including Rule Name, Priority, Date Type (specific date or specific date & time), and Period Type (single day or range).
  • Link pricing rules to packages and select specific restaurants or branches where the rule applies.
  • Configure multiple rule types, including:
    • Demand & Capacity-based — adjust prices automatically according to real-time seat availability or demand.
    • Specific Date & Time-based — apply custom prices for weekends, holidays, or special events.
    • Advance & Last-Minute Pricing — offer early-bird discounts or last-hour markups.
    • Past Performance-based — adjust prices based on recent GMV, covers, or booking volume.
    • AI-Driven Pricing (RapidCanvas) — generate automated pricing suggestions based on target sales and historical performance.
  • Set price adjustments by percentage (%) or fixed amount (currency).
  • View, search, sort, and filter pricing rules by name, status, or creation date.
  • Receive notifications for newly created or pending approval rules.
  • Track and manage price-change history, with the ability to undo changes when necessary.
  • Manage multiple branches under a group login or select individual restaurants.
  • Simulate and apply price adjustments within Allotment Management to preview effects in real time.
  • Exceed global price limits (for authorised users) with confirmation before saving allotment changes.
  • View lowest adult prices per time slot across all packages for easier comparison.
  • Lock selected package price for 10 minutes during checkout to prevent fluctuations.
  • Get notified when prices change before checkout, with a popup prompting to refresh for the latest price.
  • Display dynamic pricing indicators (e.g. Low Price or High Demand) on store and package detail pages.
  • Filter restaurants by budget range (budget / mid-range / premium casual) with localised price filters per currency.
  • Switch between per-person and per-package views with consistent slider defaults across all supported currencies.

Admin can:

  • Approve or reject Dynamic Pricing Rules via confirmation modals with success or rejection feedback.
  • Undo previously approved price changes directly from the Admin Dashboard.
  • Configure Global Pricing Limits to set maximum allowable price increases or decreases by percentage or fixed amount.
  • Receive notifications when new pricing rules require approval or review.
  • Review Price Change History to track rule modifications, approvals, and responsible users.
  • View alerts when a pricing rule exceeds the global price limit and optionally adjust the limit instantly.
  • Monitor all pricing rules through the Pricing Rule List Table, with sorting and filtering by rule priority or status.
  • Access and export booking lists displaying base prices and dynamically adjusted prices.
  • Compare old and new dynamic prices side by side in Base Price Popups for transparency.
  • Oversee group-wide or multi-restaurant configurations to ensure consistency across branches.
  • Validate client-side pricing filters and ensure price ranges align with supported currencies.

Scope

Storefront (new + old store page), Partner Portal, Admin Dashboard, hh-server booking/reservation APIs, pricing-engine microservice.

Location

Owner: Partner Portal → Pricing Rules (/pricing-rules route in hh-pegasus-monorepo). Admin: Admin Dashboard → Dynamic Pricing Rule Reviewing. Customer: Store page and package detail page (price labels, Low Price / High Demand badges).

How to find Dynamic Pricings 2.0

Partner Portal sidebar has a Pricing Rules entry. Owners can create / edit / duplicate / approve rules from there. Admins review pending rules via the Admin Dashboard review screen.

See How to set Dynamic Pricings 2.0 for the step-by-step guide.

Backend Implementation

Dynamic Pricings 2.0 introduces external pricing-engine integration for automated rule-based price adjustments with validation and token synchronization.

  • Added pricing_rule parameter support across all booking APIs (api/v5/reservations, api/partner/v1/reservations, api/v5/temporary_reservations)
  • Permit pricing_rule with nested attributes: [:id, :action_type, :value_type, :value] in strong parameters
  • Created shared concerns:
    • PricingRuleExtractor - Extract pricing rules from package parameters before form processing
    • PricingRuleInjector - Inject fetched pricing rules into package hashes for admin/owner booking flows
  • Updated controllers to extract and inject pricing rules:
    • Admin::ReservationsController - Extract pricing rules before processing, inject into create/update flows
    • Api::Partner::V1::ReservationsController - Extract pricing rules for owner bookings
    • Api::V5::RestaurantsController - Apply pricing rules in calculate_package_price
    • ReservationGuestUpdatesController - Support pricing rules in guest booking updates
  • PricingEngine::PricingRuleFetcher - Fetches available pricing rules from pricing-engine API
    • Endpoint: /api/v1/get_available_rules_by_time
    • Returns hash of package_id => pricing_rule for given restaurant, date, time, and package IDs
    • Implements retry logic (3 attempts) with exponential backoff
    • Gracefully handles failures - returns empty hash on error (fallback to base prices)
  • PricingEngine::PriceRuleValidatorService - Validates pricing rules via pricing-engine API
    • Endpoint: /api/v1/verify_active_rules
    • Validates rule parameters: id, action_type, value_type, value
    • Returns validation result with adjusted_price, rule_name, rule_type_label
    • Handles 422 responses as valid business logic (validation failed)
    • Implements comprehensive error handling and logging
  • PricingEngine::PriceAdjuster - Utility module for calculating adjusted prices
    • Supports two adjustment types:
      • Percentage: base_price * (1 ± percentage/100)
      • Fixed: base_price ± fixed_amount_in_cents
    • Ensures prices never go below zero
    • Converts fixed amounts from main currency unit to subunits (cents/satang/sen)
  • Api::V1::PricingEngineController - Internal API endpoint for frontend to fetch available rules
    • Action: available_rules - Returns pricing rules for given context
    • Used by Partner Portal to fetch rules when creating/editing bookings
  • HhPackage::ReservationPackages::ChargeCalculator
    • Added set_pricing_rules(pricing_rules) method to inject pricing rules with context
    • Apply pricing rules to base price BEFORE final price calculation
    • Priority order: pricing_rule > custom_price_cents > base_price
    • Validate pricing rules via PriceRuleValidatorService if validation not skipped
    • Recalculate totals for per-person packages (adult + kids separately)
    • Recalculate totals for per-pack packages (package price × quantity)
    • Handle promotional discounts (Come more pay less) with adjusted prices
    • Log comprehensive pricing rule application details for debugging
  • HhPackage::ReservationPackages::Metadata
    • Added time attribute for pricing rule context
    • Added skip_pricing_validation flag for admin updates (trust injected rules)
    • Apply and validate pricing rules in package metadata generation:
      • generate_ayce_like - AYCE-type packages
      • generate_ayce_multiple - Multiple AYCE packages (mix & match)
      • generate_pp_like - Per-person/Per-pack/DIY packages
    • Enrich pricing_rule with metadata: base_price_cents, adjusted_price_cents, rule_name, rule_type_label
    • Apply pricing rules to BOTH adult and kids prices independently
    • Store enriched pricing rule in package data for display and auditing
  • HhPackage::ReservationPackages::SelectedPackagesBuilder
    • Added pricing_rule parameter to constructor
    • Apply pricing rule adjustments to individual package prices
    • Recalculate promotional discounts based on adjusted prices
    • Create separate adjusted_pricing_rule for adult vs kids prices
    • Include pricing rule metadata in selected packages response
  • HhPackage::ReservationPackages::PriceFinder
    • Enhanced to accept custom_price_cents from pricing rule adjustments
    • Improved logging for price calculations with pricing rules
  • ReservationService::Create
    • Extract pricing rules BEFORE form validation (to preserve :id before transformation to :restaurant_package_id)
    • Implement Price Locking Mechanism for temporary reservations:
      1. Temporary reservation stores pricing rules in reservation.property.package_data
      2. Final reservation extracts stored pricing rules from temporary reservation
      3. Inject locked pricing rules back into params BEFORE form processing
      4. This ensures BOTH charged_price_cents AND property.package use locked prices
      5. Customer pays the price they saw during temporary reservation (prevents price changes during checkout)
    • Set pricing_rules on reservation instance before assign_charged_data
    • Comprehensive logging for pricing rule extraction and injection
  • PackageBooking::Owners::Update
    • Accept optional pricing_rules parameter in constructor
    • Set pricing rules on reservation before charge calculation
    • Apply pricing rules in all update flows (TableCheck, Weeloy, BistroCHAT, MyMenu integrations)
  • PackageBooking::Users::Update
    • Build pricing rules from package params when moving reservation property
    • Set pricing rules on new reservation during modification
  • Agents::Update (Admin updates)
    • Extract pricing rules from package params and set on reservation
    • Added skip_pricing_validation flag - trust pricing rules from inject_pricing_rules!
    • Pricing rules already validated by API fetch, no need to re-validate
  • Agents::ModifyBookingForUser
    • Block modification if reservation has payment AND pricing rule applied
    • Check pricing_rule, rule_type_label, or rule_name in package data
    • Prevents users from modifying bookings with locked-in pricing rule discounts
  • Reservation
    • Added transient attr_accessor :pricing_rules to hold pricing rules from params
    • Pricing rules are set on reservation instance before charge calculation
    • Allows assign_charged_data to access pricing rules via @pricing_rules
  • PackageServices::DynamicPricings
    • Added apply_pricing_rules method to process service
    • Fetch pricing rules from PricingRuleFetcher based on reservation date/time
    • Apply rules to calculated package data (adjust prices in-place)
    • Recalculate total_adult_price and total_price based on adjusted per-unit price
    • Store original price before adjustment for comparison
    • Format adjusted amounts using HhMoney
  • VoucherForm::Apply
    • Apply pricing rules if present in params
    • Set pricing rules with context (restaurant_id, date, time) before calculation
    • Ensure correct kids pricing by setting restaurant on calculator
  • AdminSetting - Added field pricing_engine_api_url (default:  https://price-engine.hh-engineering.my.id)
  • .env.example - Documented PRICING_ENGINE_BASE_URL environment variable
  • Added i18n strings for dynamic price display (English and Thai):
    • views.admin.reservations.dynamic_price - “Dynamic Price”
    • views.admin.reservations.base_price - “Base Price”
    • views.admin.reservations.pricing_rule - “Pricing Rule”
  • PricingEngine::SyncService
    • Actions Supported:
      • login - Sync new token with user/restaurant context
      • logout - Invalidate token immediately
      • refresh - Replace old token with new token
      • invalidate - Invalidate all tokens for a user (e.g., password change)
    • Implementation Details:
      • Base URL from ENV['PRICING_ENGINE_BASE_URL']
      • Authentication via ENV['INTERNAL_API_KEY'] in X-Internal-Api-Key header
      • Retry logic: 3 attempts with exponential backoff (0.5s base interval)
      • Timeout: 5s open, 10s read
      • Graceful degradation: Logs errors but doesn’t fail authentication flow
      • Comprehensive logging for monitoring
  • PricingEngine::SyncWorker (Sidekiq background worker)
  • Modified auth_token method to sync login event after successful authentication
    • Extract JWT token string from auth_token.token
    • Extract expiration from token payload (:exp or 'exp')
    • Enqueue PricingEngine::SyncWorker with login action
    • Non-blocking: Errors logged but don’t fail authentication
    • Payload includes: token, staff_id, staff_email, staff_name, expires_at
  • Staff
    • Added after_save :invalidate_pricing_engine_tokens_on_password_change
    • Triggers when encrypted_password changes
    • Enqueues PricingEngine::SyncWorker with invalidate action
    • Ensures security: All tokens invalidated when credentials change
    • Graceful error handling: Logs errors via APMErrorHandler
  • .env.example - Added Pricing Engine integration variables:
    • PRICING_ENGINE_SYNC_ENABLED - Feature flag for gradual rollout (default: false)
  • Automated Price Adjustments: Real-time price changes based on external pricing engine rules
  • Multiple Adjustment Types: Support for percentage and fixed amount increases/decreases
  • Validation: All pricing rules validated against external API before application
  • Price Locking: Customers pay the price they saw during temporary reservation (10-minute lock)
  • Transparency: Admin dashboard shows base price vs adjusted price side-by-side
  • Backward Compatible: Safe degradation - missing pricing rules return original prices
  • Demand & Capacity Rules: Real-time seat-availability pricing using Kafka capacity events and the capacity_summary internal API. See Dynamic Pricings 2.0 — HH Server Integration and Demand & Capacity Rules — Implementation Notes.

Admin Dashboard Enhancements

  • Admin Reservation View
    • Display dynamic pricing rule details in admin UI
    • Show base price vs adjusted price comparison
    • Display rule name, rule type, and adjustment details
    • Add Base Price Popup for transparency (compare old vs new dynamic prices)
  • Admin Reservation Form
    • Auto-reload pricing when package selection changes
    • Auto-reload pricing when date or start time changes
    • Display calculated package prices with pricing rules applied
    • Extract selected_packages from calculate_package_price API response
    • Update selectedPackages with pricing rules from API response
    • Include pricing_rule in package payload when submitting form
    • Handle pricing rule validation errors from API
    • Skip acceptRefund watcher to prevent infinite loop during auto-uncheck
  • User Quick Edit

Frontend Implementation

  • Auto-reload pricing when package selection changes
  • Auto-reload pricing when date or start time changes
  • Display calculated package prices with pricing rules applied
  • Extract selected_packages from calculate_package_price API response
  • Update selectedPackages with pricing rules from API response
  • Include pricing_rule in package payload when submitting form
  • Handle pricing rule validation errors from API
  • Skip acceptRefund watcher to prevent infinite loop during auto-uncheck
  • Real-time price updates as user modifies booking parameters
  • Fetch pricing rules when package selection changes
  • Fetch pricing rules when time selection changes
  • Apply pricing rules to selected packages for price display
  • Use pricing-engine/available_rules API to fetch rules for user modifications
  • Dynamic price recalculation on date/time/package changes
  • Integration with temporary reservation flow for price locking
  • restaurantPackageMixin.js
    • Apply pricing rules to pricing list before display
    • Support both pricing_rule (camelCase) and pricing_rule (snake_case)
    • Calculate adjusted price based on action_type (increase/decrease) and value_type (percentage/fixed)
    • Use pre-calculated adjusted_price_cents from backend if available
    • Apply currency formatting to adjusted prices
    • Include pricing rules in buildPackagePayload for form submissions
    • Display dynamic pricing rule details in admin UI
    • Show base price vs adjusted price comparison
    • Display rule name, rule type, and adjustment details
    • Add Base Price Popup for transparency (compare old vs new dynamic prices)
    • Visual indicators for pricing rule application
    • Pricing breakdown showing:
      • Original base price
      • Pricing rule applied (name, type, adjustment)
      • Final adjusted price
      • Savings/markup percentage
  • Added i18n strings for dynamic price display (English and Thai):
    • views.admin.reservations.dynamic_price - “Dynamic Price”
    • views.admin.reservations.base_price - “Base Price”
    • views.admin.reservations.pricing_rule - “Pricing Rule”
  • Localized pricing rule type labels
  • Currency-specific formatting for adjusted prices
  • Base Price Display: Shows original package price before rules
  • Adjusted Price Display: Shows final price after pricing rule application
  • Pricing Diff Indicator: Visual cues for price increases (red) vs decreases (green)
  • Rule Metadata: Display rule name, type, and adjustment details
  • Real-time Updates: Prices update automatically when booking parameters change
  • Display validation errors from pricing rule API
  • Handle pricing rule fetch failures gracefully (fallback to base prices)
  • Show user-friendly error messages for invalid pricing rules
  • Log pricing rule application failures to console for debugging
  • Prevent booking submission if pricing rule validation fails

[

github.com

https://github.com/hungryhub-team/hh-server/pull/7636

](https://github.com/hungryhub-team/hh-server/pull/7636)

Partner Portal Implementation

  • New API Module (src/api/priceEngine.js) - Comprehensive HTTP client for Pricing Engine API
    • Environment Configuration:
      • APP_BASE_API_PRICE_ENGINE_URL - Configurable pricing engine base URL
      • Supports multiple environments (production, staging, engineering, ballbot, venus)
      • Environment switcher component updated to support pricing engine URL selection
    • Core API Methods:
      • getListPricingRules(payload, headers) - Fetch paginated pricing rules with filters
      • getListPricingRulesSpecificRestaurant(id, payload) - Restaurant-specific rules using X-Restaurant-Id header
      • getDetailPricingRule(id) - Fetch single rule details
      • createPricingRule(payload, headers) - Create new pricing rule
      • updatePricingRule(id, payload, headers) - Update existing rule
      • activatePricingRule(id, headers) - Activate rule (.patch endpoint)
      • deactivatePricingRule(id, headers) - Deactivate rule (.patch endpoint)
      • duplicatePricingRule(id, headers) - Clone existing rule (.post clone endpoint)
      • deletePricingRule(id, headers) - Delete rule
      • getHistoryListPricingRules(payload, headers) - Fetch price modifier history
      • undoPricingRuleChange(id, headers) - Revert price change (.post deactivate endpoint)
      • globalPriceSetting(id) - Get global pricing limits for restaurant
      • updateGlobalPriceSetting(id, payload) - Update global pricing limits
    • HTTP Client: Uses request.util.js with automatic authorization and error handling
  • Pricing Rules List Page (/pricing-rules)
    • Navigation Integration:
      • Added new sidebar menu item with $iconPriceTag icon
      • Active state highlighting when on pricing rules routes
      • Nested routing support for create/edit/history pages
    • Search & Filtering:
      • Filter by rule status (approved/rejected)
      • Filter by rule name (text search)
      • Filter by rule type (demand_capacity, specific_date_time, past_performance, advance_last_minute, ai_driven)
      • Filter by priority (numeric)
      • Filter by schedule date (single date or range)
      • Filter by linked package
      • Filter by creation date (single date or range)
      • Filter by last update date (single date or range)
      • Filter by restaurant/branch (group login support)
      • Badge indicator showing active filter count
      • Persistent filters via URL query parameters
    • Sorting & Pagination:
      • Sort by rule name, priority, creation date, status
      • Configurable page size
      • Load more functionality for large datasets
    • PricingRulesFilterForm.vue - Main filter sidebar for active rules
      • Right-side dialog layout
      • Branch selector integration (SelectBranch component)
      • Radio button groups for date range vs single date selection
      • InputDatePicker components for schedule/created/updated date filters
      • Package dropdown with lazy loading
      • Clear all filters button
      • Show results button with validation
      • Filter state persistence in URL query params
    • PricingRulesHistoryFilterForm.vue - Filter sidebar for price change history
      • Additional “Approved/Rejected on” date filter
      • User dropdown filter (approved_by/rejected_by)
      • Lazy loading for user list
      • Rule status filter (approved/rejected)
      • Similar date range/single date selection patterns
  • Rule Type Constants (src/config/pricingRules.config.js)
    • RULE_TYPE_DEMAND_CAPACITY - “demand_capacity”
    • RULE_TYPE_SPECIFIC_DATE_TIME - “specific_date_time”
    • RULE_TYPE_PAST_PERFORMANCE - “past_performance”
    • RULE_TYPE_ADVANCE_LAST_MINUTE - “advance_last_minute”
    • RULE_TYPE_AI_DRIVEN - “ai_driven”
  • Date Type Constants:
    • RULE_DATE_TYPE_EVERYDAY - Apply rule every day
    • RULE_DATE_TYPE_SPECIFIC_DATE - Single specific date
    • RULE_DATE_TYPE_SPECIFIC_TIME - Specific time periods
    • RULE_DATE_TYPE_SPECIFIC_DATE_TIME - Both date and time
    • RULE_DATE_TYPE_DAY_OF_WEEK - Specific days of week
    • RULE_DATE_TYPE_DAY_TIME_OF_WEEK - Day + time combinations
  • Period Mode Constants:
    • RULE_PERIOD_MODE_SINGLE - Single day/time
    • RULE_PERIOD_MODE_RANGE - Date/time range
  • UI Components & Enhancements
    • IconPriceTag.vue - Pricing rules icon (supports active state)
    • IconPriceTagGradient.vue - Gradient version for special states
    • IconClockRotateLeft.vue - History/undo icon
    • IconFloppyDisk.vue - Save icon
    • IconCopy.vue - Duplicate icon
    • IconUndo.vue - Undo changes icon
    • IconPlusCircle.vue - Add new rule icon
    • IconTrendingUp.vue / IconTrendingDown.vue - Price trend indicators
    • IconConfirm.vue - Success confirmation with gradient support (success/danger variants)
    • IconWarningModal.vue - Enhanced warning modal icon with gradient variants
    • IconWarningChip.vue - Warning chip icon with background color support
    • BadgeGradient.vue - Gradient badge for special promotions
      • CSS: .badge-gradient with linear gradient (red to white)
      • Props: label (string, required)
      • Dimensions: 140px width, 4px padding, 50px border-radius
    • CollapsibleAlert.vue - Expandable alert for pricing warnings/notices
      • Collapsible content with slide transition
      • Warning type styling (orange border, white background, box shadow)
      • Slots: title, content
      • Collapse button with rotate animation
      • Uses SlideTransition.vue for smooth expand/collapse
    • SlideTransition.vue - Smooth height-based slide transitions
      • Configurable duration (default 400ms)
      • Auto-height adjustment for dynamic content
      • Prevents animation conflicts with isAnimating flag
      • Exposes updateHeight() method for manual triggering
    • FadeTransition.vue - Fade + scale transitions
      • Configurable duration and easing function
      • Scale effect (0.95 <-> 1.0) combined with opacity
      • Lifecycle hooks: onBeforeEnter, onEnter, onBeforeLeave, onLeave
  • InputSelect Improvements:
    • Multiple Selection Support:
      • Added multiple prop support
      • Custom selection display: shows count when > 1 items selected
      • Improved selection chips rendering
    • Styling Enhancements:
      • New .input-select-multiple class for multi-select styling
      • Dynamic field height for multiple selections
      • Improved error state styling with red border
      • Hover/focus state improvements (blue border on non-error states)
      • Removed default border, added transitions for smoother UX
    • Accessibility:
      • Better keyboard navigation
      • Clear visual feedback for focus and hover states
  • InputDatePicker Enhancements:
    • InputDatePickerV2.vue - Improved date picker with better UX
      • clearable prop for resettable dates
      • isOnGoingDate prop for “Ongoing” display
      • Click handlers separated (append icon vs clear icon)
      • Unique ID generation with nanoid for menu anchoring
      • Emits both update:model-value and input events
      • Proper model value synchronization with watchers
    • InputDatePicker Updates:
      • Added isOnGoingDate prop for continuous date ranges
      • Displays “Ongoing” text when isOnGoingDate is true
      • Disabled state styling improvements
  • InputTimeSelect Enhancements:
    • Added endTime prop for time range filtering
    • Added isOnGoingTime prop for “Ongoing” time display
    • Added isAnyTime prop with “Anytime” option
    • Dynamic time options based on start/end time
    • “Ongoing” text display when isOnGoingTime is true
  • SelectMultipleBranch.vue - Multi-select branch picker
    • Multiple branch selection with checkbox UI
    • “All Branches” option (mutually exclusive with specific branches)
    • Automatic deselection logic: selecting “All” clears specific branches, selecting specific branch removes “All”
    • Required validation support
    • Integration with user store for restaurant list
  • SelectBranch.vue - Single branch selector (updated)
    • Improved formatting for branch value handling (string/number conversion)
    • Cleaner code with better string manipulation
  • Dynamic Pricing Indicator on Bookings:
    • ModelDynamicPricing.vue - Popup dialog showing pricing rule details
      • Displays rule title (rule type + rule name)
      • Shows base price with strikethrough styling
      • Shows dynamic (adjusted) price with bold emphasis
      • Currency formatting with formatMoney utility
      • Uses currencySymbol composable for localization
      • Popup menu triggered by clicking pricing info
      • Close icon for dismissing the popup
  • Pricing Rule Metadata Display:
    • Rule type label (e.g., “Demand & Capacity”)
    • Rule name custom identifier
    • Base price vs adjusted price comparison
    • Savings/markup calculation and display
  • NotificationsPricingRules.vue - Pricing rule notifications component
    • Display count of pending approvals
    • Expandable notification list with v-list-group
    • Notification categories: pricing rules, bookings, reviews, others
    • Pricing rule icon with gradient styling
    • Date/time formatting for notifications
    • Click to redirect to pricing rules page
    • Mark as read functionality on click
    • Load more functionality for pagination
    • Unread indicator styling (primary color, active state)
    • Integration with useNotificationsStore for state management
  • NotificationsMenu.vue - Updated main notifications dropdown
    • Added NotificationsPricingRules component (currently hidden via feature flag)
    • temporaryHideNotificationsPricingRules flag for gradual rollout
    • Prepared for pricing rule notification integration
  • .env.example - Added pricing engine environment variable
  • EnvSwitcher Component:
  • Application Config (src/config/app.config.js):
    • Export APP_BASE_API_PRICE_ENGINE_URL constant
    • Read from storage switcher or fallback to production pricing engine URL
    • Environment-aware configuration for development/staging/production

[

github.com

https://github.com/hungryhub-team/book-bite/pull/1001

](https://github.com/hungryhub-team/book-bite/pull/1001)

Pricing-Engine API Endpoints

MethodPathURLDescriptionResponsePayload
POST/api/v1/get_available_rules_by_timehttps://{pricing-engine-api}/api/v1/get_available_rules_by_timeExternal pricing-engine endpoint consumed by hh-server fetcher service.restaurant_id, date, restaurant_package_ids[]Time-slot rule list mapped to packages.
POST/api/v1/verify_active_ruleshttps://{pricing-engine-api}/api/v1/verify_active_rulesExternal pricing-engine endpoint used to validate active pricing rules.restaurant_id, date, time, packages[].pricing_rulesValidation result, rule metadata, and adjusted price context.

Improvement Log

Feature NameDateWhat ChangedDescription
Dynamic Pricing 2.0Feb 2026Add dynamic pricing 2.0

PRD

Dynamic Pricings 2.0 PRD