Skip to content

Explain one night's rate #98

Open
Open

Description

@selvarajuv

Blocked by: #95, #97

Problem

When the manager opens a night, they need to see why it's priced the way it is to trust or challenge it. The range route deliberately leaves out the explanation to stay small.

Goal

One endpoint returns everything about one night: the rate, its range, the factors behind it in euros, and the events affecting it.

Scope

  • A night detail endpoint, e.g. GET /hotels/{id}/recommendations/{date}.
  • The response:
    • rate, interval low and high, model version and when the snapshot was made;
    • the factor breakdown in €, with the base rate, so the factors add up to the rate;
    • the events affecting the night, in full;
    • the previous snapshot's rate and the change;
    • the manager's own rate and latest feedback, if any.
  • 404 when the hotel has no trained model.
  • Descriptions and examples in the API docs.

Considerations

  • Factor names must make sense to a hotel manager (e.g. "Concert at 3Arena", "Saturday", "Rain"), not model column names.
  • Many small factors make the explanation hard to read; consider grouping those under a threshold into one "Other factors" line, keeping the total.

Acceptance criteria

  • The endpoint returns the rate, range, factors and events for a night.
  • Factors plus the base rate equal the rate.
  • The figures match the saved snapshot for that night.
  • Tests cover a night with and without events, and no trained model.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiRoutes, services, models and repositories for recommendations and feedbackfeatureIntroduces 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