Description
SearchEventsRequest and filter_events_by_keywords only filter by event type, location, time, and general keywords. Users searching for "affordable concerts in Lagos" or "small intimate events" have no way to filter by price or venue capacity — two of the most common search criteria for ticket buyers.
Requirements & context
- Add to
SearchEventsRequest:
min_price: Optional[float] and max_price: Optional[float]
max_capacity: Optional[int] (useful for "intimate" events)
- Update
filter_events_by_keywords to apply these filters when present
- The NLP
extract_keywords function should detect price intent keywords: "cheap", "affordable", "free" → set max_price=0 or max_price=5000; "premium", "VIP" → set min_price=10000
- Add the price hint detection to
extract_keywords return dict as price_hints: { min_price, max_price }
- Write tests for each new filter individually and in combination
Suggested execution
git checkout -b feat/search-price-capacity-filters
- Update
src/types_custom.py SearchEventsRequest
- Update
src/search_utils.py
- Write tests
Guidelines
- PR must include:
Closes #[issue_id]
- Timeframe: 48 hours
Description
SearchEventsRequestandfilter_events_by_keywordsonly filter by event type, location, time, and general keywords. Users searching for "affordable concerts in Lagos" or "small intimate events" have no way to filter by price or venue capacity — two of the most common search criteria for ticket buyers.Requirements & context
SearchEventsRequest:min_price: Optional[float]andmax_price: Optional[float]max_capacity: Optional[int](useful for "intimate" events)filter_events_by_keywordsto apply these filters when presentextract_keywordsfunction should detect price intent keywords: "cheap", "affordable", "free" → setmax_price=0ormax_price=5000; "premium", "VIP" → setmin_price=10000extract_keywordsreturn dict asprice_hints: { min_price, max_price }Suggested execution
src/types_custom.pySearchEventsRequestsrc/search_utils.pyGuidelines
Closes #[issue_id]