mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
fix(roadtrip): keep a booked night out of the day list, and off the traveller's stops
Three things the first pass got wrong. A stop a booking puts on the day is for road trip mode, which needs the hotel in the driving chain. The day planner already shows that booking as its own overnight block, so the row there would be the same hotel twice. It is hidden in Days whatever the service-stop switch says, and the switch goes back to meaning what it says: the petrol stations the traveller added. Cancelling a night from the road trip popup took the stop with it. That control means "this is a pause now, not a night", and the stop sits mid-drive where re-adding it would land it at the end of the day. The booking now hands the stop over instead of deleting it. Moving a booking whose stop belongs to the traveller put a second one on the new day and left the first behind, which is the duplicate this change exists to remove. Only a booking's own stop moves now. Stays booked before this shipped get theirs from the migration, not from the next edit they happen to receive.
This commit is contained in:
@@ -48,6 +48,11 @@ export const assignmentSchema = z.object({
|
||||
// not a place (booking arrival / morning hotel). null = inherit the day default.
|
||||
// Inert when the previous timeline element is a place.
|
||||
incoming_leg_transport_mode: z.string().nullable().optional(),
|
||||
// The lodging booking that put this stop on the day, when one did. The day
|
||||
// planner already shows that booking as its own overnight block, so it hides
|
||||
// this row and leaves it to road trip mode, which is the view that needs the
|
||||
// hotel in the driving chain. Null for every stop a traveller placed.
|
||||
accommodation_id: z.number().nullable().optional(),
|
||||
participants: z.array(assignmentParticipantSchema).optional(),
|
||||
created_at: z.string().optional(),
|
||||
place: assignmentPlaceSchema,
|
||||
|
||||
Reference in New Issue
Block a user