mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-14 00:01:03 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user