Add Power BI reporting endpoints — flat tabular data via API key auth

Three read-only endpoints under /reporting/:
- /hotels       hotel dimension table (tier, stars, review score)
- /rates        full rates fact — all sources, room types, scrape history in one flat table
- /occupancy    Newbook occupancy per date × room category

Rates UNION covers Booking.com scrapes, direct competitor engines (with
configured room/rate labels), and own hotel Newbook headline rates.
Authenticated via X-API-Key header; key stored in system_config.reporting_api_key.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-14 17:27:50 +00:00
parent d5ce38859d
commit e481ad5258
3 changed files with 264 additions and 3 deletions

View file

@ -23,7 +23,8 @@ INSERT INTO system_config (config_key, config_value, description) VALUES
('booking_scraper_proxy_username', NULL, 'Proxy username for playwright_proxy backend'),
('booking_scraper_proxy_password', NULL, 'Proxy password for playwright_proxy backend'),
('sync_newbook_current_rates_enabled', 'false', 'Enable automatic Newbook current rates sync (true/false)'),
('sync_newbook_current_rates_time', '05:20', 'Newbook current rates sync time (HH:MM)')
('sync_newbook_current_rates_time', '05:20', 'Newbook current rates sync time (HH:MM)'),
('reporting_api_key', NULL, 'Static API key for Power BI reporting endpoints (X-API-Key header)')
ON CONFLICT (config_key) DO NOTHING;
-- ============================================