diff --git a/backend/services/booking_scraper.py b/backend/services/booking_scraper.py index fa8b0c1..5fdffce 100644 --- a/backend/services/booking_scraper.py +++ b/backend/services/booking_scraper.py @@ -295,12 +295,16 @@ def cleanup_stale_batches(db: Session, max_age_minutes: int = 60): def get_active_hotels(db: Session) -> List[Dict[str, Any]]: - """Return all active hotels that have a booking_com_url (needed for hotel-page scraping).""" + """Return own + competitor hotels with a booking_com_url (for hotel-page scraping). + Market-tier hotels are excluded — they were auto-discovered from search results and + are not hotels we specifically want to track at rate-plan level.""" rows = db.execute( text(""" SELECT id, booking_com_id, name, booking_com_url FROM booking_com_hotels - WHERE is_active = TRUE AND booking_com_url IS NOT NULL + WHERE is_active = TRUE + AND booking_com_url IS NOT NULL + AND tier IN ('own', 'competitor') ORDER BY display_order, id """) ).fetchall()