You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's no way to read the data we're ingesting or the hotel booking
history. We need a real HTTP surface over the data,
built on the n-tier flow (routes → services → repository → database) so routes never touch sessions
directly.
Goal
A documented, working REST API (visible at /docs) that serves hotels, room types, daily
performance, and the external signals, plus a placeholder recommendation endpoint
Scope
Hotels / room types: list + get (+ create where it helps seeding). Reuses existing
HotelCreate/Read, RoomTypeCreate/Read schemas
Daily performance: list by hotel/room type + date range; response includes the computed
occupancy/adr/revpar (schema already does this)
External signals (read-only): endpoints to query weather, events, flight_arrivals by city/airport
date range (for demo + sanity-checking the backfill)
Recommendation endpoint (stub): GET /hotels/{id}/recommendations?date=... returning a placeholder
payload in the final response shape (rate + explanation + confidence interval), so the contract
is locked before the model lands
Consistent patterns: pagination on list endpoints, 404s, Pydantic response models, and a thin
service layer calling repositories
Acceptance criteria
/docs lists all new endpoints with request/response schemas.
Hotels, room types, and daily-performance endpoints return real DB data
Signal endpoints return weather/events/flights filtered by location + date range
List endpoints paginate and unknown IDs return 404
Recommendation endpoint returns the agreed shape (rate, interval, explanation) from a
placeholder
No route accesses a SQLAlchemy session directly — all DB access via repository layer.
Tests for each endpoint (happy path + 404) against the CI Postgres.
Activity
[-]API to serve hotel & signal data[/-][+]API to erve hotel & signal data[/+][-]API to erve hotel & signal data[/-][+]API to Serve Hotel & Signal Data[/+]