Dynamic Pricings 2.0
Note: This page documents Dynamic Pricings 2.0, the rule-based pricing system backed by the
hungryhub-team/pricing-engineRails 8 microservice. Replaces the per-packagehh_package_pricingsrule-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
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_ruleparameter support across all booking APIs (api/v5/reservations,api/partner/v1/reservations,api/v5/temporary_reservations) - Permit
pricing_rulewith nested attributes:[:id, :action_type, :value_type, :value]in strong parameters - Created shared concerns:
PricingRuleExtractor- Extract pricing rules from package parameters before form processingPricingRuleInjector- 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 flowsApi::Partner::V1::ReservationsController- Extract pricing rules for owner bookingsApi::V5::RestaurantsController- Apply pricing rules incalculate_package_priceReservationGuestUpdatesController- 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_rulefor 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)
- Endpoint:
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
- Endpoint:
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
- Percentage:
- Ensures prices never go below zero
- Converts fixed amounts from main currency unit to subunits (cents/satang/sen)
- Supports two adjustment types:
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
- Action:
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
PriceRuleValidatorServiceif 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
- Added
HhPackage::ReservationPackages::Metadata- Added
timeattribute for pricing rule context - Added
skip_pricing_validationflag for admin updates (trust injected rules) - Apply and validate pricing rules in package metadata generation:
generate_ayce_like- AYCE-type packagesgenerate_ayce_multiple- Multiple AYCE packages (mix & match)generate_pp_like- Per-person/Per-pack/DIY packages
- Enrich
pricing_rulewith 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
- Added
HhPackage::ReservationPackages::SelectedPackagesBuilder- Added
pricing_ruleparameter to constructor - Apply pricing rule adjustments to individual package prices
- Recalculate promotional discounts based on adjusted prices
- Create separate
adjusted_pricing_rulefor adult vs kids prices - Include pricing rule metadata in selected packages response
- Added
HhPackage::ReservationPackages::PriceFinder- Enhanced to accept
custom_price_centsfrom pricing rule adjustments - Improved logging for price calculations with pricing rules
- Enhanced to accept
ReservationService::Create- Extract pricing rules BEFORE form validation (to preserve
:idbefore transformation to:restaurant_package_id) - Implement Price Locking Mechanism for temporary reservations:
- Temporary reservation stores pricing rules in
reservation.property.package_data - Final reservation extracts stored pricing rules from temporary reservation
- Inject locked pricing rules back into params BEFORE form processing
- This ensures BOTH
charged_price_centsANDproperty.packageuse locked prices - Customer pays the price they saw during temporary reservation (prevents price changes during checkout)
- Temporary reservation stores pricing rules in
- Set
pricing_ruleson reservation instance beforeassign_charged_data - Comprehensive logging for pricing rule extraction and injection
- Extract pricing rules BEFORE form validation (to preserve
PackageBooking::Owners::Update- Accept optional
pricing_rulesparameter in constructor - Set pricing rules on reservation before charge calculation
- Apply pricing rules in all update flows (TableCheck, Weeloy, BistroCHAT, MyMenu integrations)
- Accept optional
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_validationflag - trust pricing rules frominject_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, orrule_namein package data - Prevents users from modifying bookings with locked-in pricing rule discounts
Reservation- Added transient
attr_accessor :pricing_rulesto hold pricing rules from params - Pricing rules are set on reservation instance before charge calculation
- Allows
assign_charged_datato access pricing rules via@pricing_rules
- Added transient
PackageServices::DynamicPricings- Added
apply_pricing_rulesmethod to process service - Fetch pricing rules from
PricingRuleFetcherbased on reservation date/time - Apply rules to calculated package data (adjust prices in-place)
- Recalculate
total_adult_priceandtotal_pricebased on adjusted per-unit price - Store original price before adjustment for comparison
- Format adjusted amounts using
HhMoney
- Added
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_URLenvironment 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 contextlogout- Invalidate token immediatelyrefresh- Replace old token with new tokeninvalidate- 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']inX-Internal-Api-Keyheader - 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
- Base URL from
- Actions Supported:
PricingEngine::SyncWorker(Sidekiq background worker)- Modified
auth_tokenmethod to sync login event after successful authentication- Extract JWT token string from
auth_token.token - Extract expiration from token payload (
:expor'exp') - Enqueue
PricingEngine::SyncWorkerwith login action - Non-blocking: Errors logged but don’t fail authentication
- Payload includes:
token,staff_id,staff_email,staff_name,expires_at
- Extract JWT token string from
Staff- Added
after_save :invalidate_pricing_engine_tokens_on_password_change - Triggers when
encrypted_passwordchanges - Enqueues
PricingEngine::SyncWorkerwithinvalidateaction - Ensures security: All tokens invalidated when credentials change
- Graceful error handling: Logs errors via APMErrorHandler
- Added
- .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_summaryinternal 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_packagesfromcalculate_package_priceAPI response - Update
selectedPackageswith pricing rules from API response - Include
pricing_rulein package payload when submitting form - Handle pricing rule validation errors from API
- Skip
acceptRefundwatcher to prevent infinite loop during auto-uncheck
- User Quick Edit
- 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_rulesAPI to fetch rules for user modifications github.com https://github.com/hungryhub-team/hh-server/pull/7636 github.com https://github.com/hungryhub-team/hh-server/pull/7805
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_packagesfromcalculate_package_priceAPI response - Update
selectedPackageswith pricing rules from API response - Include
pricing_rulein package payload when submitting form - Handle pricing rule validation errors from API
- Skip
acceptRefundwatcher 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_rulesAPI 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) andpricing_rule(snake_case) - Calculate adjusted price based on
action_type(increase/decrease) andvalue_type(percentage/fixed) - Use pre-calculated
adjusted_price_centsfrom backend if available - Apply currency formatting to adjusted prices
- Include pricing rules in
buildPackagePayloadfor 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 filtersgetListPricingRulesSpecificRestaurant(id, payload)- Restaurant-specific rules usingX-Restaurant-IdheadergetDetailPricingRule(id)- Fetch single rule detailscreatePricingRule(payload, headers)- Create new pricing ruleupdatePricingRule(id, payload, headers)- Update existing ruleactivatePricingRule(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 rulegetHistoryListPricingRules(payload, headers)- Fetch price modifier historyundoPricingRuleChange(id, headers)- Revert price change (.post deactivate endpoint)globalPriceSetting(id)- Get global pricing limits for restaurantupdateGlobalPriceSetting(id, payload)- Update global pricing limits
- HTTP Client: Uses
request.util.jswith automatic authorization and error handling
- Environment Configuration:
- Pricing Rules List Page (
/pricing-rules)- Navigation Integration:
- Added new sidebar menu item with
$iconPriceTagicon - Active state highlighting when on pricing rules routes
- Nested routing support for create/edit/history pages
- Added new sidebar menu item with
- 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
- Navigation Integration:
- 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 dayRULE_DATE_TYPE_SPECIFIC_DATE- Single specific dateRULE_DATE_TYPE_SPECIFIC_TIME- Specific time periodsRULE_DATE_TYPE_SPECIFIC_DATE_TIME- Both date and timeRULE_DATE_TYPE_DAY_OF_WEEK- Specific days of weekRULE_DATE_TYPE_DAY_TIME_OF_WEEK- Day + time combinations
- Period Mode Constants:
RULE_PERIOD_MODE_SINGLE- Single day/timeRULE_PERIOD_MODE_RANGE- Date/time range
- UI Components & Enhancements
IconPriceTag.vue- Pricing rules icon (supports active state)IconPriceTagGradient.vue- Gradient version for special statesIconClockRotateLeft.vue- History/undo iconIconFloppyDisk.vue- Save iconIconCopy.vue- Duplicate iconIconUndo.vue- Undo changes iconIconPlusCircle.vue- Add new rule iconIconTrendingUp.vue/IconTrendingDown.vue- Price trend indicatorsIconConfirm.vue- Success confirmation with gradient support (success/danger variants)IconWarningModal.vue- Enhanced warning modal icon with gradient variantsIconWarningChip.vue- Warning chip icon with background color supportBadgeGradient.vue- Gradient badge for special promotions- CSS:
.badge-gradientwith linear gradient (red to white) - Props:
label(string, required) - Dimensions: 140px width, 4px padding, 50px border-radius
- CSS:
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.vuefor smooth expand/collapse
SlideTransition.vue- Smooth height-based slide transitions- Configurable duration (default 400ms)
- Auto-height adjustment for dynamic content
- Prevents animation conflicts with
isAnimatingflag - 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
multipleprop support - Custom selection display: shows count when > 1 items selected
- Improved selection chips rendering
- Added
- Styling Enhancements:
- New
.input-select-multipleclass 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
- New
- Accessibility:
- Better keyboard navigation
- Clear visual feedback for focus and hover states
- Multiple Selection Support:
- InputDatePicker Enhancements:
InputDatePickerV2.vue- Improved date picker with better UXclearableprop for resettable datesisOnGoingDateprop for “Ongoing” display- Click handlers separated (append icon vs clear icon)
- Unique ID generation with nanoid for menu anchoring
- Emits both
update:model-valueandinputevents - Proper model value synchronization with watchers
- InputDatePicker Updates:
- Added
isOnGoingDateprop for continuous date ranges - Displays “Ongoing” text when
isOnGoingDateis true - Disabled state styling improvements
- Added
- InputTimeSelect Enhancements:
- Added
endTimeprop for time range filtering - Added
isOnGoingTimeprop for “Ongoing” time display - Added
isAnyTimeprop with “Anytime” option - Dynamic time options based on start/end time
- “Ongoing” text display when
isOnGoingTimeis true
- Added
- 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
formatMoneyutility - Uses
currencySymbolcomposable 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
useNotificationsStorefor state management
- NotificationsMenu.vue - Updated main notifications dropdown
- Added
NotificationsPricingRulescomponent (currently hidden via feature flag) temporaryHideNotificationsPricingRulesflag for gradual rollout- Prepared for pricing rule notification integration
- Added
.env.example- Added pricing engine environment variable- EnvSwitcher Component:
- Added
baseApiPriceEngineUrlto environment configurations - Support for all environments (env, engineering, ballbot, venus, production, custom)
- Production pricing engine URL: https://pricing-engine-prod.hungryhub.com/api/partner/v1/
- Staging/dev pricing engine URL: https://price-engine.hh-engineering.my.id/api/partner/v1/
- Environment switcher stores pricing engine URL in local storage
- Added
- Application Config (
src/config/app.config.js):- Export
APP_BASE_API_PRICE_ENGINE_URLconstant - Read from storage switcher or fallback to production pricing engine URL
- Environment-aware configuration for development/staging/production
- Export
[
github.com
https://github.com/hungryhub-team/book-bite/pull/1001
](https://github.com/hungryhub-team/book-bite/pull/1001)
Pricing-Engine API Endpoints
| Method | Path | URL | Description | Response | Payload |
|---|---|---|---|---|---|
| POST | /api/v1/get_available_rules_by_time | https://{pricing-engine-api}/api/v1/get_available_rules_by_time | External 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_rules | https://{pricing-engine-api}/api/v1/verify_active_rules | External pricing-engine endpoint used to validate active pricing rules. | restaurant_id, date, time, packages[].pricing_rules | Validation result, rule metadata, and adjusted price context. |
Improvement Log
| Feature Name | Date | What Changed | Description |
|---|---|---|---|
| Dynamic Pricing 2.0 | Feb 2026 | Add dynamic pricing 2.0 |
PRD
Related Resources
- Customer-facing booking flow: Dynamic Pricings 2.0 — Customer Booking Flow (HH Pegasus)
- HH Server integration: Dynamic Pricings 2.0 — HH Server Integration
- pricing-engine customer API: Customer Booking API
- Engineering specs for the
pricing-enginemicroservice - Partner-Portal setup guide: How to set Dynamic Pricings 2.0
- Legacy per-package system: Dynamic Pricings 1.0