Fetching metadata from the HF Docker repository...
-
feat: implement booking allocation engine (Phases 1β10)β
Michael-Antony +1: Claude Sonnet 4.6 Builds the complete event-driven allocation engine:
Core infrastructure:
- Redis Streams queue manager with consumer groups, DLQ, XAUTOCLAIM PEL recovery
- Async Redis connection pool factory
- Motor singleton for MongoDB (merchant settings)
- 3-layer settings loader: Redis cache β MongoDB β .env defaults
Workers:
- Scheduler worker: polls unassigned bookings with FOR UPDATE SKIP LOCKED, enqueues to Redis, reclaims stale PEL messages via XAUTOCLAIM
- Allocation worker: CTE-based eligible partner query, weighted scoring (distance 40% / rating 30% / load 20% / experience 10%), exponential backoff retry, DLQ on permanent failure
- Expiry worker and response worker entry points
Database:
- Migrations 002β005 with trans. schema prefix for all tables and indexes
- migrate.py: creates trans schema, skips 001 (spa_bookings owned by Athoma)
- 005_allocation_indexes.sql: partial covering index on unassigned bookings, attempts exclusion index
- Lazy get_settings() with Optional[Settings] for Pβ¦
-
Initial commit: Booking Allocation Engine with complete documentation