mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 05:26:47 +00:00
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:
@@ -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) });
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user