rates/backend/api
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
..
__init__.py Add Rate Monitor app — Booking.com + direct booking engine competitor rates 2026-07-05 12:06:30 +00:00
analysis.py Rate Analysis: fix hotel detail 500 + timeline 422, match frontend shapes; signed % delta badge 2026-07-05 15:01:57 +00:00
bookability.py Port occupancy sync + category ordering from the forecasting version 2026-07-05 14:18:03 +00:00
competitors.py Parity: like-for-like tariff matching instead of headline vs lead-in 2026-07-06 07:57:17 +00:00
direct.py Add benchmark & tier-offset configuration UI to Direct Rates Manage tab 2026-07-06 07:09:10 +00:00