fix(reservations): keep day_id on partial updates of time-only bookings

A partial update that left day_id out (a notes-only PUT, an MCP
update_reservation or update_transport call) re-derived the day from the
stored reservation_time whenever one was set. A time-only value such as
"12:00" resolves to no day, so the booking's day_id was written as null and
it vanished from its day in the planner. The end_day_id branch did the same
when a time-only reservation_end_time was sent.

The day is now derived only when the time carries a date that resolves to a
trip day; otherwise an omitted day_id or end_day_id keeps the stored value.
A dated time still re-pins the day, an explicit day_id null still clears it,
and a cleared end time still clears end_day_id. REST and both MCP update
tools share updateInTx, so the fix covers all three.

Tests: service unit cases (RESV-SVC-044..048), an e2e case per behaviour
on PUT /api/trips/:tripId/reservations/:id, and an update_reservation MCP
case, all seeded with the ORM factories.

Fixes #3025
This commit is contained in:
John Jahn
2026-11-10 10:05:22 +01:00
committed by Maurice
parent 6b086eaed5
commit 8e8cff8105
5 changed files with 155 additions and 27 deletions
+1 -1
View File
@@ -15,6 +15,6 @@
"src/nest/places/places.service.ts": 1549,
"src/nest/plugins/plugin-runtime.service.ts": 1460,
"src/nest/plugins/runtime/plugin-sdk.ts": 1093,
"src/nest/reservations/reservations.service.ts": 1237,
"src/nest/reservations/reservations.service.ts": 1228,
"src/nest/vacay/vacay.service.ts": 1409
}