fix(planner): let the day list see which stop a booking wrote

The row shapers name every column they pass on, and accommodation_id was in
none of them. So the field the day list hides on never reached the client, and
the booked night was listed as an ordinary place next to the overnight block
that already named it. The stop was correct in the table the whole time; the
three read paths just dropped it on the way out.

The stamp on the freshly written stop had the same hole from the other side: the
INSERT went in without the booking id and an UPDATE added it afterwards, so the
row handed back in the answer, the one the client that booked the night puts
straight into its store, carried none. It goes in with the INSERT now.

The shared link gains the same filter. It has no road trip view to need the stop
and already shows the booking as its own chip on the day, so the row was only
ever the same hotel twice.
This commit is contained in:
Maurice
2026-09-13 12:59:19 +02:00
parent e3471e2dc8
commit d0d3f455a8
9 changed files with 72 additions and 9 deletions
@@ -607,6 +607,11 @@ describe('the day stop a booking implies', () => {
expect(stops).toHaveLength(1);
expect(stops[0]).toMatchObject({ place_id: place.id, accommodation_id: accommodation.id });
expect(mirror.created).toMatchObject({ id: stops[0].id, day_id: day.id, place_id: place.id });
// On the answer, not only in the table. This copy is what the client that booked
// the night puts in its store, and accommodation_id is the only thing telling the
// day list this row is the booking it already shows in the header. Without it the
// hotel appears a second time among the day's places until the next reload.
expect(mirror.created.accommodation_id).toBe(accommodation.id);
});
it('ACC-022 the stop lands at the end of the day, where you arrive at a hotel', () => {