mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-22 03:50:30 +00:00
fix(roadtrip): keep the stay on each visit, not on the place (#3092)
A nullable day_assignments.stay_minutes holds the stay of one visit; a visit without one keeps reading the place's duration, so existing trips drive as before. REST PUT /trips/:tripId/assignments/:id/stay and the MCP tool set_assignment_stay write it with day_edit.
This commit is contained in:
@@ -60,7 +60,7 @@ export function stopSpan(assignment: Assignment): DaySpan | null {
|
||||
if (start === null) return null;
|
||||
const end = clockMinutes(assignment.assignment_end_time ?? assignment.place.end_time);
|
||||
if (end !== null && end > start) return { start, end };
|
||||
const duration = assignment.place.duration_minutes ?? 0;
|
||||
const duration = assignment.stay_minutes ?? assignment.place.duration_minutes ?? 0;
|
||||
return { start, end: duration > 0 ? Math.min(start + duration, MINUTES_PER_DAY) : null };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user