Skip to content

API to Serve Hotel & Signal Data #38

Closed

Description

@selvarajuv

Problem

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

  1. changed the title [-]API to serve hotel & signal data[/-] [+]API to erve hotel & signal data[/+] on Oct 6, 2026
  2. changed the title [-]API to erve hotel & signal data[/-] [+]API to Serve Hotel & Signal Data[/+] on Oct 6, 2026
  3. linked a pull request that will close this issuefeat: api to serve hotel signal data #45on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

featureIntroduces a new and complete feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions