Pricing Engine API Documentation
Documentation Overview
This is a standalone microservice for managing restaurant dynamic pricing rules with JWT authentication and multi-restaurant support.
Documentation Structure
Core Documentation
- 001-QUICK-START.md - Get started in 5 minutes
- 002-ARCHITECTURE.md - System architecture and design
- 003-AUTHENTICATION.md - JWT authentication flow
- 004-API-ENDPOINTS.md - Complete API reference
Feature Documentation
- 005-PRICING-RULES.md - Pricing rules management
- 006-DATE-TIME-CONDITIONS.md - Date/time condition types
- 007-GLOBAL-PRICING-SETTINGS.md - Restaurant pricing limits
- 008-ENUM-REFERENCE.md - All enum values reference
Advanced Features
- 009-REDIS-CACHING.md - Caching implementation
- 010-APM-MONITORING.md - Application monitoring
- 012-DEVELOPMENT-STANDARDS.md - Code standards
- 013-DEMAND-CAPACITY-CONDITIONS.md - Capacity-based rules
- 014-PRICE-MODIFIER.md - Price modifier lifecycle & management
- 015-PRICING-RECOMMENDATION-API.md - Pricing recommendation API
- 016-CUSTOMER-BOOKING-API.md - Customer booking API
- 017-CAPACITY-DEMAND-IMPLEMENTATION-PLAN.md - Capacity and demand implementation plan
- 018-DEMAND-CAPACITY-IMPLEMENTATION.md - Real implementation notes for Demand & Capacity rules
- 019-INTERNAL-ACTIVE-PRICE-MODIFIERS-API.md - Internal active modifier data API
- Demand_Capacity_Tiered_Seat_Discount_20260827150000.md - Tiered seat discount design and integration contract
- DEMAND-CAPACITY-FRONTEND-API-GUIDE.md - Frontend integration guide for demand-capacity pricing APIs
Technical Documentation
- 011-ENVIRONMENT-SETUP.md - Development setup
- SCHEMA_ERD.md - Database schema diagrams
API Testing
- postman/ - Postman collection and environments
Quick Links
- API Base URL (Staging):
https://price-engine.hh-engineering.my.id - Health Check:
GET /up - API Documentation:
GET /api-docs
Current Implementation Status
✅ Implemented Features
- JWT Bearer token authentication
- Multi-restaurant support with context handling
- Pricing rules CRUD operations
- Date/time conditions (6 types)
- Global pricing settings (per restaurant)
- Price change history tracking
- Rule activation/deactivation
- Rule cloning
- Redis caching for performance
- APM monitoring with Elastic APM
- Kafka refresh events for downstream active-modifier snapshots
📋 API Endpoints
Partner API (/api/partner/v1/*)
- Pricing Rules: Full CRUD + activate/deactivate/clone
- Global Settings: GET (auto-create), PATCH
- Price History: List, show, undo
Public API (/api/v1/*)
- Pricing Rules: Read-only (list, show)
Internal API (/api/internal/v1/*)
- Token Sync: login, logout, refresh, invalidate
- Active Price Modifiers: read-only active/current-or-future modifier definitions for trusted pricing evaluators
Getting Started
- Read 001-QUICK-START.md for setup
- Import Postman collection from
postman/directory - Configure authentication (see 003-AUTHENTICATION.md)
- Start testing with the collection
Technology Stack
- Framework: Ruby on Rails 7+ (API mode)
- Database: PostgreSQL
- Cache: Redis
- Monitoring: Elastic APM
- Authentication: JWT (from HH-Server)
- API Documentation: Swagger/OpenAPI (via Rswag)