From 3d252ac994ebd132ae2f46cfc495210480b87f4c Mon Sep 17 00:00:00 2001 From: Maurice Date: Fri, 4 Sep 2026 19:21:00 +0200 Subject: [PATCH] fix(places): keep the hour a new place has always defaulted to The road trip rail reads `duration_minutes` as a stay, and a place created without one claimed an hour nobody had entered. The branch answered that by binding NULL instead, which is right for the rail and wrong for everything else: the column declares DEFAULT 60, three tests assert it, and the comment on one of them says so in as many words. That default reaches every place in TREK, not only the ones on a drive. So the hour stays, and the road trip solves its own problem where it arises. A stop added from the corridor search already brings its own figure with it (RoadtripStopPopup's STOP_KINDS: ten minutes for fuel, twenty for a rest area, thirty for a charger), and saveStopDraft passes it through, so the kinds that would be misread as an hour never take the default in the first place. --- server/src/nest/places/places.service.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server/src/nest/places/places.service.ts b/server/src/nest/places/places.service.ts index 86a611dea..5a7a21f7f 100644 --- a/server/src/nest/places/places.service.ts +++ b/server/src/nest/places/places.service.ts @@ -242,13 +242,14 @@ export class PlacesService { // 0 is a legitimate value for all four (Null Island, a free entry, a // drive-by stop) and the falsy coercion silently threw it away. // - // `duration_minutes` stays NULL when nobody says otherwise, rather than being - // invented as an hour. It is read in exactly one place — the road trip rail's - // "Stay" — and a default meant every place ever created claimed a one-hour stop - // the traveller had never entered, with no way to tell the two apart. + // The hour stays the default for a place created without one, which is what it + // has always been and what the column itself declares. The road trip rail reads + // the value as a stay, and a stop added from the corridor search brings its own + // figure — ten minutes for fuel, twenty for a rest area — so the kinds that would + // be misread as an hour never take the default in the first place. tripId, name, description || null, lat ?? null, lng ?? null, address || null, category_id || null, price ?? null, currency || null, - place_time || null, end_time || null, duration_minutes ?? null, notes || null, image_url || null, + place_time || null, end_time || null, duration_minutes ?? 60, notes || null, image_url || null, google_place_id || null, google_ftid || null, osm_id || null, website || null, phone || null, transport_mode || 'walking', route_geometry || null, route_color || null, stop_type || null, );