rates/backend
jtricerolph 3b501f95c5 Parity: like-for-like tariff matching instead of headline vs lead-in
The check compared Newbook's FIRST tariff (typically flexi B&B) against
Booking.com's lead-in card (often prepaid) — apples vs oranges, e.g.
21 Jul flagged B&B FLEX £289 vs a prepaid BC rate whose true comparable
was B&B PPAY £279.

- classify Newbook tariffs from names/descriptions (PPAY/prepay/advance/
  ADV/NRF/saver = prepaid; DBB/dinner/half board = dinner-inclusive)
- use the scraped BC rate's flags (free_cancellation/no_prepayment/
  breakfast_included) to pick the cheapest COMPARABLE tariff per date,
  excluding tariffs not bookable for that date (success=false, min-stay
  >1, unmet advance-purchase windows)
- tiered fallback (matched -> any non-dinner -> any -> legacy headline),
  recorded per alert in room_category as 'TARIFF vs BC basis'
- shared gather_comparisons() now drives both the daily job and
  GET /competitors/parity (issues gain newbook_tariff, booking_basis,
  match_quality, expected_rate)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 07:57:17 +00:00
..
api Parity: like-for-like tariff matching instead of headline vs lead-in 2026-07-06 07:57:17 +00:00
jobs Parity: like-for-like tariff matching instead of headline vs lead-in 2026-07-06 07:57:17 +00:00
services Wire up direct-rates column; remove dormant pause-on-block flow 2026-07-06 06:01:56 +00:00
auth.py Fix require_cap TypeError, rewrite /analysis/comparison, add room category sync 2026-07-05 13:47:10 +00:00
database.py Add Rate Monitor app — Booking.com + direct booking engine competitor rates 2026-07-05 12:06:30 +00:00
Dockerfile Fix backend startup: launch Xvfb directly, not via xvfb-run 2026-07-05 16:35:03 +00:00
main.py Add Rate Monitor app — Booking.com + direct booking engine competitor rates 2026-07-05 12:06:30 +00:00
migrate_direct_data.py Restore guestline-monitor features: room stock/occupancy, rate history, room stats 2026-07-06 06:50:37 +00:00
requirements.txt Scraper stealth: headful+xvfb, playwright-stealth, coherent UA, warm-up, click-paginate 2026-07-05 16:26:01 +00:00
scheduler.py Rate parity: expected-markup config, alert writer job, alerts UI + direct-link UI 2026-07-06 07:30:41 +00:00
schema.sql Pin Booking.com search to a dest_id 2026-07-05 21:49:57 +00:00