Skip to content

feat(calendar): match the recommendations API on main - #157

Merged
Jrodrigo06 merged 10 commits into
auth-me-hotelfrom
calendar-new-shape
Nov 27, 2026
Merged

Jrodrigo06 merged 10 commits into
auth-me-hotelfrom
calendar-new-shape

Conversation

@Jrodrigo06

@Jrodrigo06 Jrodrigo06 commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

What

The calendar matches the recommendations API on main after #155. It shows the next 30 nights for the signed-in user's hotel, labels every rate "before VAT", and shows the manager's rate beside ours in the hover card. It also fixes hover-card problems that only real data showed: amounts wrapping, the card running off screen, and too many factor lines (now the six largest plus "Smaller effects combined").

Why

#155 removed rate_basis, confidence_interval and currency, and decision 0076 says the frontend must say rates are before VAT.

How to check

Screenshots

Hover card on 25 December, real data

Hover card on 25 December, real data

Manager's rate beside ours on 5 December

Manager's rate beside ours on 5 December

Notes

  • Not included:
  • On the Neon data, every one of the next 30 nights has events_source: "missing", so the model treats event inputs as unknown even though the calendar lists events. That's a data question for the backend.
  • Decision 0065 now records the six-factor cap.

Adds lead_days (days from today, 0 for today and past nights), rate_basis
"nett" (before VAT, decision 0076) and manager_rate (set on about one night
in seven), and a "lead days N" factor as the backend names it. Drops
weather_source, which the API no longer sends.
parseAmount turns the API's Decimal strings into numbers, in one place,
and keeps null as null. Recommendations also carry rateBasis, leadDays and
managerRate from the response.
The calendar asks for tonight and the 29 nights after it in one call (the
API allows 90). The month grid shows those nights in whichever month is
open, and the previous and next buttons stay within the months they fall
in. Days outside the window stay grey.
The model learns and the API returns rates before VAT (decision 0076), so
the header, a line beside the colour chips and the hover card say so. The
label follows rate_basis: an older model's "arr" rate reads "as the night's
average" instead, since the API doesn't say whether it includes VAT.
When the manager has set their own rate for a night, the card shows
"Manager's rate €185" next to the recommended rate. It isn't shown in the
day cell.
#155 drops `rate_basis` from the recommendations response: every rate is
before VAT (decisions 0076, 0082). The mock no longer sends it, the API
module no longer maps it, and the "as the night's average" branch is gone;
the calendar and hover card say "before VAT" outright. The mock's comment
points at the explanation's new home in services/recommendations/.
A long factor name like "December with the night before a public holiday"
squeezed its amount onto two lines ("+" over "€20"). The amount no longer
shrinks or wraps; the name truncates instead.
On real data a night can have 15 factor lines, and the card for a night in
the top or bottom row fit neither above nor below it: flip and shift can't
help then. Floating UI's size middleware caps the card at the height free
on its side, and the card scrolls inside that.
The real model explains a night with up to 15 lines, many of them pairs
like "December with the night before a public holiday". The hover card
shows the six largest and adds every other one into "Smaller effects
combined" before rounding, so the lines still add up to the rate.
Recorded in decision 0065.
The API names the one room type it prices "DOUBLE" (decision 0079), so the
header read "DOUBLE room". formatRoomType in lib/format.js shows it in
sentence case, and the mock now sends "DOUBLE" as the API does.
@Jrodrigo06
Jrodrigo06 merged commit b8497ce into main Nov 27, 2026
8 checks passed
@Jrodrigo06
Jrodrigo06 deleted the calendar-new-shape branch November 27, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants