fix(tours): open a saved ski tour as saved and keep what its router planned

A saved ski tour now opens with the line, heights, time, build and
planned legs it was saved with, read from the place this device keeps,
and nothing is asked of the piste router until a point, an option or the
discipline changes. Opened offline, while TREK Places is down or with
piste routing switched off, it no longer turns every leg straight, and a
rename saves the planned tour as it was. A kept line whose length is not
the tour's is another save's, and the tour is planned afresh.

- the save names the legs the router planned (ski_planned_legs, checked
  against the tour's own legs); get_tour_plan reports each leg routed or
  drawn from them instead of from the build alone, a tour that names none
  counting as planned only with the router's time
- copies keep ski_options in every path: in the trip, taken over, kept
  in a collection and made from one (collection_tours gets the column in
  the same unshipped migration)
- the route summary shows the data build, the km of runs, the height
  skied down on them and the lift rides, and the credit the server sends
  in place of a fixed one; a tour opened as saved says so
- answers refused while piste routing is off, or planned on an older kept
  copy, are not remembered, so they are asked again later
- terrain heights between known ones are filled in one walk along the line
- i18n: five summary keys in all 27 locales
This commit is contained in:
Maurice
2026-10-20 21:07:06 +02:00
parent 1d72fbd25f
commit ae699187f7
63 changed files with 1002 additions and 98 deletions
@@ -46,6 +46,7 @@ export class CollectionTours {
source_trip_title!: string;
source_tour_name!: string;
created_at!: string & Opt;
ski_options?: string | null;
tourTypeRef!: Ref<TourTypes>;
savedByRef?: Ref<Users> | null;
}
@@ -93,7 +94,10 @@ export const CollectionToursSchema = defineEntity({
source_trip_title: p.text(),
source_tour_name: p.text(),
created_at: p.type(DbTimestampType).defaultRaw(`CURRENT_TIMESTAMP`),
tourTypeRef: () => p.manyToOne(TourTypes).ref().joinColumn('tour_type').hidden().index('idx_collection_tours_tour_type'),
savedByRef: () => p.manyToOne(Users).ref().joinColumn('saved_by').nullable().hidden().index('idx_collection_tours_saved_by'),
ski_options: p.text().nullable(),
tourTypeRef: () =>
p.manyToOne(TourTypes).ref().joinColumn('tour_type').hidden().index('idx_collection_tours_tour_type'),
savedByRef: () =>
p.manyToOne(Users).ref().joinColumn('saved_by').nullable().hidden().index('idx_collection_tours_saved_by'),
},
});
+10 -1
View File
@@ -8,6 +8,7 @@ import {
paddleLockSchema,
paddleRegionBoundarySchema,
paddleRegionGraphStatsSchema,
skiPlannedLegsSchema,
skiRouteOptionsSchema,
tourChangeSchema,
tourFixedLegSchema,
@@ -197,12 +198,20 @@ export const TOUR_HIKING_PREFERENCES: JsonColumn<HikingPreferences | null> = {
export interface TourSkiRoute {
options: SkiRouteOptions;
build: string | null;
/** The legs the piste router planned, by the index of the point each starts at; absent where the save did not say. */
planned_legs?: number[];
}
const tourSkiRouteSchema = z.object({
options: skiRouteOptionsSchema,
build: z.string().nullable(),
planned_legs: skiPlannedLegsSchema.optional(),
});
/** A ski tour's piste router options. A broken row reads as none, and the planner offers the defaults. */
export const TOUR_SKI_ROUTE: JsonColumn<TourSkiRoute | null> = {
column: 'tours.ski_options',
schema: z.object({ options: skiRouteOptionsSchema, build: z.string().nullable() }).nullable(),
schema: tourSkiRouteSchema.nullable(),
fallback: () => null,
};
@@ -41,4 +41,5 @@ export interface CollectionToursTable {
source_trip_title: string;
source_tour_name: string;
created_at: InsertOptional<string>;
ski_options: InsertOptional<string | null>;
}
@@ -7,12 +7,14 @@ import { Migration } from '@mikro-orm/migrations';
* (`TOUR_SKI_ROUTE` in json-columns.ts). NULL for every other type, for an
* imported track and for a ski tour saved before the router. Reopened, the
* tour is planned with the same options, and a newer build of the piste data
* can be offered instead of applied.
* can be offered instead of applied. A tour kept in a collection keeps the
* same column, so a copy made from it is planned as the tour it was saved from.
*/
export class Migration20200101046140_a_ski_tour_keeps_its_piste_router_options extends Migration {
override name = 'Migration20200101046140_a_ski_tour_keeps_its_piste_router_options';
override up(): void {
this.addSql('ALTER TABLE tours ADD COLUMN ski_options TEXT');
this.addSql('ALTER TABLE collection_tours ADD COLUMN ski_options TEXT');
}
}
@@ -36,6 +36,8 @@ export interface CollectionTourRow {
run_pace_seconds_per_km: number | null;
ski_discipline: string | null;
ski_technique: string | null;
/** A ski tour's piste router options and build as JSON text, as the tour it was saved from kept them. */
ski_options: string | null;
boat_type: string | null;
water_context: string | null;
paddle_speed_kmh: number | null;
+7 -1
View File
@@ -30,6 +30,8 @@ interface TourCopiedColumns {
run_pace_seconds_per_km: number | null;
ski_discipline: string | null;
ski_technique: string | null;
/** A ski tour's piste router options and build as JSON text; absent where a read does not take it. */
ski_options?: string | null;
boat_type: string | null;
water_context: string | null;
paddle_speed_kmh: number | null;
@@ -50,8 +52,11 @@ interface TourCopyFacet extends TourCopiedColumns {
taken_over_from_tour_name: string | null;
}
/** The columns as a copy writes them: a ski tour's options are always said, null where there are none. */
type CopiedColumns = Omit<TourCopiedColumns, 'ski_options'> & { ski_options: string | null };
/** The columns a copy carries over, read off any row that has them, and nothing else of it. */
export function copiedColumns(row: TourCopiedColumns): TourCopiedColumns {
export function copiedColumns(row: TourCopiedColumns): CopiedColumns {
return {
tour_type: row.tour_type,
distance: row.distance,
@@ -69,6 +74,7 @@ export function copiedColumns(row: TourCopiedColumns): TourCopiedColumns {
run_pace_seconds_per_km: row.run_pace_seconds_per_km,
ski_discipline: row.ski_discipline,
ski_technique: row.ski_technique,
ski_options: row.ski_options ?? null,
boat_type: row.boat_type,
water_context: row.water_context,
paddle_speed_kmh: row.paddle_speed_kmh,
+3 -2
View File
@@ -33,10 +33,11 @@ function stageStopsOrNull(points: Parameters<typeof tourStageStopsOf>[0]): TourL
}
/** A ski tour's piste router options and the build its legs ran on, where it keeps them; nothing for any other tour. */
function skiRouteFacts(r: TourListRow): Pick<TourListItem, 'ski_options' | 'ski_route_build'> {
function skiRouteFacts(r: TourListRow): Pick<TourListItem, 'ski_options' | 'ski_route_build' | 'ski_planned_legs'> {
if (r.tour_type !== 'ski' || !r.ski_options) return {};
const route = decodeJson(TOUR_SKI_ROUTE, r.ski_options, 'tour');
return route ? { ski_options: route.options, ski_route_build: route.build } : {};
if (!route) return {};
return { ski_options: route.options, ski_route_build: route.build, ski_planned_legs: route.planned_legs ?? null };
}
/**
+10 -6
View File
@@ -93,8 +93,11 @@ function roundKm(km: number): number {
interface PlanLegSource {
/** The line is a recorded track (the tour stores no control points of its own), so no router planned it. */
recorded: boolean;
/** SKI-02: the planner drew every leg straight between its points (a planned ski tour), so no router planned one. */
drawn?: boolean;
/**
* SKI-02: whether the planner drew the leg starting at this point straight
* (a ski tour's leg the piste router did not plan); left out, no leg was drawn.
*/
drawn?: (leg: number) => boolean;
}
/** A fixed leg's line as points of a line: latitude and longitude, no height. */
@@ -112,14 +115,15 @@ function straightLine(from: TourWaypoint, to: TourWaypoint): GeometryPoint[] {
/**
* The legs between consecutive control points, each saying whether the router
* planned it, it follows a recorded track, or it is a fixed line. A planned
* ski tour's leg is a straight line between its points, as the planner drew it.
* planned it, it follows a recorded track, or it is a fixed line. A ski tour's
* leg the piste router did not plan is a straight line between its points, as
* the planner drew it.
*/
export function planLegs(points: readonly TourWaypoint[], { recorded, drawn = false }: PlanLegSource): PlanLeg[] {
const unfixed = recorded ? 'track' : drawn ? 'free' : 'routed';
export function planLegs(points: readonly TourWaypoint[], { recorded, drawn }: PlanLegSource): PlanLeg[] {
return points.slice(1).map((to, index) => {
const from = points[index] as TourWaypoint;
const leg = from.fixed_leg ?? null;
const unfixed = recorded ? 'track' : drawn?.(index) ? 'free' : 'routed';
const line = leg ? legLine(leg.geometry) : unfixed === 'free' ? straightLine(from, to) : null;
return {
from_sequence: from.sequence,
+2 -1
View File
@@ -50,7 +50,8 @@ function skiFields(input: TourCreateCommand): Pick<TourUpdate, 'ski_discipline'
function skiRouteField(input: TourCreateCommand): string | null {
if (input.tour_type !== 'ski' || !input.ski_discipline || !input.ski_options) return null;
const options = skiOptionsForDiscipline(input.ski_discipline, input.ski_options);
return encodeJson(TOUR_SKI_ROUTE, { options, build: input.ski_route_build ?? null });
const planned = input.ski_planned_legs ? { planned_legs: [...input.ski_planned_legs] } : {};
return encodeJson(TOUR_SKI_ROUTE, { options, build: input.ski_route_build ?? null, ...planned });
}
/**
+22 -6
View File
@@ -30,6 +30,22 @@ function withDays(tour: TourListItem, days: ReadonlyMap<number, TourDay[]>) {
return { ...tour, days: days.get(tour.place_id) ?? [] };
}
/**
* SKI-02: which legs of a planned ski tour the planner drew straight: those
* the piste router did not plan. A tour saved without naming its planned legs
* counts as planned throughout only when it kept the router's time, which the
* planner sends only when the router planned every leg.
*/
function skiDrawnLegs(
tour: Pick<TourListItem, 'tour_type' | 'ski_planned_legs' | 'ski_route_build' | 'duration'>,
): ((leg: number) => boolean) | undefined {
if (tour.tour_type !== 'ski') return undefined;
const plannedLegs = tour.ski_planned_legs;
if (plannedLegs) return (leg) => !plannedLegs.includes(leg);
const everyLeg = Boolean(tour.ski_route_build) && tour.duration != null;
return () => !everyLeg;
}
/** What get_tour_plan reads of one saved tour, before a day's visits are added. */
interface PlanRead {
detail: TourDetailResponse;
@@ -61,11 +77,7 @@ function planOf({ detail, days, line, names }: PlanRead, run: WalkProgress | nul
waypoints: planPoints(detail.tour.tour_type, named, run),
// ACT-01: the recorded tracks assigned to the tour, with their values and without their lines.
activities: (detail.activities ?? []).map(withoutLine),
// SKI-02: a ski tour saved before the piste router, or with none of its legs planned by it, was drawn straight.
legs: planLegs(detail.waypoints, {
recorded,
drawn: detail.tour.tour_type === 'ski' && !detail.tour.ski_route_build,
}),
legs: planLegs(detail.waypoints, { recorded, drawn: skiDrawnLegs(detail.tour) }),
line: saved,
...(isWalk ? { run: run ? planRun(run) : null } : {}),
derived: derivedFields(detail, { controlsFromTrack, line: saved, run }),
@@ -105,7 +117,7 @@ export class ToursMcp {
@Tool({
name: 'list_tours',
description:
'List the saved tours of a trip (hikes, city walks, runs, bike tours, paddle tours, rides on horseback and ski and winter tours planned or imported in the Tours addon): name, type (hike, walk for a city walk, run, bike, kayak for a paddle tour, horse for a ride, or ski for a ski and winter tour; a ride has no time worked out, so its duration is null), where it came from (origin: trek, gpx for an imported GPX, KML or KMZ file, or wanderer), distance in km, ascent and descent in metres, the stored routing limit of a hike (max_hiking_difficulty, SAC T1 to T6) and its route choices (hiking_preferences: avoid_climbs for gentler ways, avoid_steps, avoid_ferries; weightings, never a grade of the path), the profile a bike tour is routed for (bike_profile: touring for paved cycle paths and quiet roads, road for asphalt, gravel for gravel and farm tracks, mtb for rough tracks; a routing preference, never a statement that a way is rideable or safe), the profile and pace of a run (run_profile: running for runnable, mostly paved ways in towns and parks, trail for forest tracks and natural paths up to mountain paths (T2); a routing preference, never a statement that a way can be run; run_pace_seconds_per_km, the pace the runners planned with, null while they entered none; its duration is the distance at that pace and nothing else, no climb, descent or difficulty is in it, and it is a plan, never a recorded time), the discipline of a ski tour (ski_discipline: alpine, snowboard, cross_country, touring for ski touring, snowshoe or winter_hike; snowshoeing and winter hiking are ski tours, a hike is summer only; ski_technique for cross-country only: classic, skating or unknown when the travellers did not know; a planned ski tour has its legs planned by the piste router along the runs, lifts and trails of OpenStreetMap where that data reaches (ski_options: the router options it was planned with, ski_route_build: the piste data build) and drawn straight elsewhere, an imported one is kept as recorded; its duration is the estimate of the router only when every leg was planned by it, else null, and nothing in it says anything about snow, avalanches or whether a run or trail is open), the boat, water and chosen speed of a paddle tour (boat_type, water_context, paddle_speed_kmh in km/h, null while the suggested speed of the boat applies), the check bench of a paddle tour (paddle_check: how far the OpenStreetMap obstacle data covers its line and how many obstacles are open, to check again or decided by the travellers; a planning status, never a safety or legal clearance), for a city walk the number of its stations (station_count: its points without the shaping points and the way back of a loop), their stays as far as entered (station_stay_minutes) and how many have none (station_stays_unknown), whether a tour still waits for its way to be planned (route_pending: saved with its points only, so its distance and walking time stay null until someone opens it in the planner and saves it), for a multi-day tour the number of stages its route is split into (stage_count: one route planned whole, each stage ending at a stop marked as its end; null for a tour of one day) and the stops they run between (stage_stops, in route order with key and coordinates: stage n runs from stop n-1 to stop n, and is known by the key of the stop it starts at), the revision (raised by every saved change of the tour), the recorded tracks assigned to a tour (activity_tracks) and, for a recorded track, the tour it documents (activity_of), when an imported track was recorded (track_started_at, track_ended_at; null when the file carried no times), the time a tour without a planned time (an import) is estimated to take (time_estimate: minutes and basis, din33466 for a hike by the hiking signpost rule DIN 33466 from its distance, ascent and descent, run_pace for a run at the pace entered; worked out on reading and without breaks, never a recorded or planned time; minutes null when the track has no heights, and time_estimate null where nothing estimates it, a tour the planner timed among them, whose duration is its time), and the days of the trip each tour is on (tour_stage_key names the stage a day holds by its starting stop, null where the day holds the whole tour; a stage may also be on no day yet).',
'List the saved tours of a trip (hikes, city walks, runs, bike tours, paddle tours, rides on horseback and ski and winter tours planned or imported in the Tours addon): name, type (hike, walk for a city walk, run, bike, kayak for a paddle tour, horse for a ride, or ski for a ski and winter tour; a ride has no time worked out, so its duration is null), where it came from (origin: trek, gpx for an imported GPX, KML or KMZ file, or wanderer), distance in km, ascent and descent in metres, the stored routing limit of a hike (max_hiking_difficulty, SAC T1 to T6) and its route choices (hiking_preferences: avoid_climbs for gentler ways, avoid_steps, avoid_ferries; weightings, never a grade of the path), the profile a bike tour is routed for (bike_profile: touring for paved cycle paths and quiet roads, road for asphalt, gravel for gravel and farm tracks, mtb for rough tracks; a routing preference, never a statement that a way is rideable or safe), the profile and pace of a run (run_profile: running for runnable, mostly paved ways in towns and parks, trail for forest tracks and natural paths up to mountain paths (T2); a routing preference, never a statement that a way can be run; run_pace_seconds_per_km, the pace the runners planned with, null while they entered none; its duration is the distance at that pace and nothing else, no climb, descent or difficulty is in it, and it is a plan, never a recorded time), the discipline of a ski tour (ski_discipline: alpine, snowboard, cross_country, touring for ski touring, snowshoe or winter_hike; snowshoeing and winter hiking are ski tours, a hike is summer only; ski_technique for cross-country only: classic, skating or unknown when the travellers did not know; a planned ski tour has its legs planned by the piste router along the runs, lifts and trails of OpenStreetMap where that data reaches (ski_options: the router options it was planned with, ski_route_build: the piste data build, ski_planned_legs: the legs it planned, each by the index of the control point it starts at, null when the save did not say) and drawn straight elsewhere, an imported one is kept as recorded; its duration is the estimate of the router only when every leg was planned by it, else null, and nothing in it says anything about snow, avalanches or whether a run or trail is open), the boat, water and chosen speed of a paddle tour (boat_type, water_context, paddle_speed_kmh in km/h, null while the suggested speed of the boat applies), the check bench of a paddle tour (paddle_check: how far the OpenStreetMap obstacle data covers its line and how many obstacles are open, to check again or decided by the travellers; a planning status, never a safety or legal clearance), for a city walk the number of its stations (station_count: its points without the shaping points and the way back of a loop), their stays as far as entered (station_stay_minutes) and how many have none (station_stays_unknown), whether a tour still waits for its way to be planned (route_pending: saved with its points only, so its distance and walking time stay null until someone opens it in the planner and saves it), for a multi-day tour the number of stages its route is split into (stage_count: one route planned whole, each stage ending at a stop marked as its end; null for a tour of one day) and the stops they run between (stage_stops, in route order with key and coordinates: stage n runs from stop n-1 to stop n, and is known by the key of the stop it starts at), the revision (raised by every saved change of the tour), the recorded tracks assigned to a tour (activity_tracks) and, for a recorded track, the tour it documents (activity_of), when an imported track was recorded (track_started_at, track_ended_at; null when the file carried no times), the time a tour without a planned time (an import) is estimated to take (time_estimate: minutes and basis, din33466 for a hike by the hiking signpost rule DIN 33466 from its distance, ascent and descent, run_pace for a run at the pace entered; worked out on reading and without breaks, never a recorded or planned time; minutes null when the track has no heights, and time_estimate null where nothing estimates it, a tour the planner timed among them, whose duration is its time), and the days of the trip each tour is on (tour_stage_key names the stage a day holds by its starting stop, null where the day holds the whole tour; a stage may also be on no day yet).',
inputSchema: { tripId: idSchema },
annotations: TOOL_ANNOTATIONS_READONLY,
when: addonGate(ADDON_IDS.TOURS),
@@ -120,7 +132,11 @@ export class ToursMcp {
@Tool({
name: 'get_tour_plan',
description:
<<<<<<< HEAD
'Read one saved tour of a trip as the travellers saved it: its facts (tour: place_id, name, tour_type, distance, heights and walking time as stored, null when not known; the routing options as list_tours describes them; revision, raised by every saved change; the days it is on), its ordered control points (start, via and end, each with its sequence and its key, the same across saves; an import without its own shows the two ends of its track), where it came from (provenance) and its legs. Drafts in a browser are never visible: only saved tours exist here, and reading changes nothing, not the tour, its revision nor any visit. A control point with linked_place_id stands for that place of the trip (linked_place_name names it); it keeps its own coordinates. A control point with stage_end true ends a stage of a multi-day tour, and the next stage begins there; the stages run in the order of the route, the first from the start, the last to the end, and a tour without such a point is a tour of one day. legs lists every step from one control point to the next (from_sequence, to_sequence, from_key, to_key) with its kind: routed (planned by the router), track (part of a recorded line, an import without control points of its own, which no router planned), ferrata (follows a via ferrata, name gives it), free (drawn by hand and checked by nothing; every leg of a planned ski tour is free, a straight line between its points), portage (a paddle tour carried over land) or horse_route (a ride only: a section of a signposted horse route from OpenStreetMap in the direction the rider chose; the fixed_leg of its control point says signposted, with or against the direction the route is signposted in, null where it is not signposted one way, and access, the metres of each horse=* value its ways carried when it was taken, unknown where untagged; being on a horse route is no permission to ride it); length_km is the length of the line a fixed leg keeps (for the leg of a ski tour the straight line) and null for a routed or track leg, whose length is not stored apart. line gives the saved line in brief: point_count, has_heights and a preview thinned to 200 points; null while the tour waits for its way to be planned. A paddle tour also carries its obstacle checklist (obstacle_check): the obstacles of the OpenStreetMap data along its line, the decisions the travellers made about them and their own portages and locks; a planning aid, never a safety or legal clearance. A city walk (tour_type walk) has stations for control points, shaping points and the way back of a loop aside, each with every field spelled out: key (the visits of a day are kept by it), name, stay_minutes (the stay in minutes; 0 for a point only passed through, null when not known), importance (optional or must; null for a normal station), protected (true for a station any change you propose has to keep where it is: neither removed, replaced nor moved; the travellers can still edit it themselves in the app), opening_hours (as OpenStreetMap writes them; a hint to check, never a promise; null when none is known) and visit_status. Visits belong to one day of the walk: name that day with dayId (one of its days) to read the status of each station that day (planned, visited or skipped) and run (the day, its assignment and what is still open); without dayId visit_status and run are null. A station visited or skipped that day is done: do not ask about it again or move it to another day. dayId is for a city walk only. The recorded tracks assigned to the tour (activities, ACT-01) each name their execution (assignment_id and day_id, null for none), the recording (track: its tour in the trip, origin, file name, when it came in) and what the recording measures (metrics: distance_km, elevation_gain_m and elevation_loss_m, null without heights; started_at, ended_at and elapsed_minutes from the first to the last time on its points, pauses included, null when the file carried no times, never estimated); these are the values of the recording, the planned values of the tour stay apart and unchanged. derived names the fields worked out on reading rather than stored with the tour: never present them as saved facts. tour.time_estimate is one of them where present: an estimate from distance and heights (or the pace of a run), never a time the travellers planned or recorded.',
=======
'Read one saved tour of a trip as the travellers saved it: its facts (tour: place_id, name, tour_type, distance, heights and walking time as stored, null when not known; the routing options as list_tours describes them; revision, raised by every saved change; the days it is on), its ordered control points (start, via and end, each with its sequence and its key, the same across saves; an import without its own shows the two ends of its track), where it came from (provenance) and its legs. Drafts in a browser are never visible: only saved tours exist here, and reading changes nothing, not the tour, its revision nor any visit. A control point with linked_place_id stands for that place of the trip (linked_place_name names it); it keeps its own coordinates. A control point with stage_end true ends a stage of a multi-day tour, and the next stage begins there; the stages run in the order of the route, the first from the start, the last to the end, and a tour without such a point is a tour of one day. legs lists every step from one control point to the next (from_sequence, to_sequence, from_key, to_key) with its kind: routed (planned by the router), track (part of a recorded line, an import without control points of its own, which no router planned), ferrata (follows a via ferrata, name gives it), free (drawn by hand and checked by nothing; a leg of a planned ski tour is routed where the piste router planned it and free, a straight line between its points, where it did not), portage (a paddle tour carried over land) or horse_route (a ride only: a section of a signposted horse route from OpenStreetMap in the direction the rider chose; the fixed_leg of its control point says signposted, with or against the direction the route is signposted in, null where it is not signposted one way, and access, the metres of each horse=* value its ways carried when it was taken, unknown where untagged; being on a horse route is no permission to ride it); length_km is the length of the line a fixed leg keeps (for the leg of a ski tour the straight line) and null for a routed or track leg, whose length is not stored apart. line gives the saved line in brief: point_count, has_heights and a preview thinned to 200 points; null while the tour waits for its way to be planned. A paddle tour also carries its obstacle checklist (obstacle_check): the obstacles of the OpenStreetMap data along its line, the decisions the travellers made about them and their own portages and locks; a planning aid, never a safety or legal clearance. A city walk (tour_type walk) has stations for control points, shaping points and the way back of a loop aside, each with every field spelled out: key (the visits of a day are kept by it), name, stay_minutes (the stay in minutes; 0 for a point only passed through, null when not known), importance (optional or must; null for a normal station), protected (true for a station any change you propose has to keep where it is: neither removed, replaced nor moved; the travellers can still edit it themselves in the app), opening_hours (as OpenStreetMap writes them; a hint to check, never a promise; null when none is known) and visit_status. Visits belong to one day of the walk: name that day with dayId (one of its days) to read the status of each station that day (planned, visited or skipped) and run (the day, its assignment and what is still open); without dayId visit_status and run are null. A station visited or skipped that day is done: do not ask about it again or move it to another day. dayId is for a city walk only. The recorded tracks assigned to the tour (activities, ACT-01) each name their execution (assignment_id and day_id, null for none), the recording (track: its tour in the trip, origin, file name, when it came in) and what the recording measures (metrics: distance_km, elevation_gain_m and elevation_loss_m, null without heights; started_at, ended_at and elapsed_minutes from the first to the last time on its points, pauses included, null when the file carried no times, never estimated); these are the values of the recording, the planned values of the tour stay apart and unchanged. derived names the fields worked out on reading rather than stored with the tour: never present them as saved facts.',
>>>>>>> 44601ec9c (fix(tours): open a saved ski tour as saved and keep what its router planned)
inputSchema: {
tripId: idSchema,
placeId: idSchema.describe('The place id of the tour, as list_tours gives it'),