fix(roadtrip): sort a booked night by its check-in, and clear the lint the cut left

Pinning an afternoon stop sorted that one and left the hotel it was booked around
sitting behind it. The day's auto-sort reads each stop's own hour, and a booked
night has none: nobody types a time into a hotel row, they type a check-in, and
that lives on the booking. It counts now, so the night moves with everything else
instead of staying where it was dropped.

The assignments e2e builds its own tables and had neither the accommodation
column nor day_accommodations, so every create in that file 500'd as soon as the
insert learned to carry a booking id. Both are there now.

And the shared lint, which is stricter than the other two and which I had not run:
three leftovers from taking the check-out out of the chain, none of them used any
more.
This commit is contained in:
Maurice
2026-09-13 16:19:57 +02:00
parent c351a0471c
commit fcee6bd2c5
5 changed files with 36 additions and 4 deletions
+1 -2
View File
@@ -17,7 +17,6 @@ import type {
} from './planning-types';
import {
computeSchedule,
parseClock,
deriveDriveWarnings,
refuelsRange,
isServiceStopType,
@@ -159,7 +158,7 @@ export function assembleRoadtrip({
legs.reduce((sum, l) => sum + (l?.duration ?? 0), 0) + inbound.reduce((sum, l) => sum + (l?.duration ?? 0), 0);
const schedule = chain.schedule;
const legVias = routed.map((l) => l?.vias ?? []);
const stops = chain.stops.map((s, index) => {
const stops = chain.stops.map((s) => {
const snap = s.automaticNight ? undefined : allSnaps[stopKey(s)];
const line = spurFor(snap);
if (line) accessLines.push({ line, meters: snap!.meters, stopKey: stopKey(s) });
+3 -1
View File
@@ -5,7 +5,9 @@ export function continueSchedule(
stops: RoadtripStop[],
schedule: Schedule,
legs: (number | undefined)[],
dayNumber: number,
/** Unused since a check-out stopped shaping the chain; kept so the call sites and
* their specs read the same as every other scheduler entry point. */
_dayNumber?: number,
): Schedule {
const entries = schedule.entries.map((entry) => ({ ...entry }));
const warnings = [...schedule.warnings];