mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-21 14:36:31 +00:00
Tours: tests follow the provenance read and the shared day assignment, the tours addon ends MCP sessions, a line without a point is not copied
The repository stubs of the tour service tests answer findProvenance, which getTour and createTour read since P2C-02. Switching the Tours addon off now ends live MCP sessions like every other addon that gates a tool (MCP-GATE-PARITY-001). copyTour refuses a line without a point instead of placing the copy at 0/0, and new tests cover the reachable paths of the copy, the source check and the provenance of a snapshot without its import record, including a trip copy keeping that record. On the client the shared day assignment hands the plan exactly the tour and the day, the new visibility store is reset between tests, and the tests of the sidebar, the detail, the phone sheet and the origin section match the views this PR built.
This commit is contained in:
@@ -47,5 +47,6 @@ export const MCP_GATED_ADDON_IDS: readonly AddonId[] = [
|
||||
ADDON_IDS.JOURNEY,
|
||||
ADDON_IDS.PACKING,
|
||||
ADDON_IDS.ROADTRIP,
|
||||
ADDON_IDS.TOURS,
|
||||
ADDON_IDS.VACAY,
|
||||
];
|
||||
|
||||
@@ -354,14 +354,14 @@ export class ToursService {
|
||||
this.toursRepo.findProvenance(tid, pid),
|
||||
this.placesRepo.findInTrip(pid, tid),
|
||||
]);
|
||||
const start = parseRouteGeometry(place?.route_geometry)[0];
|
||||
// A tour without a line has nothing to copy.
|
||||
if (!source || !provenance || !place?.route_geometry) throw new NotFoundException('Tour not found');
|
||||
const start = parseRouteGeometry(place.route_geometry)[0];
|
||||
if (!source || !provenance || !place?.route_geometry || !start) throw new NotFoundException('Tour not found');
|
||||
const id = await this.placesRepo.insertTourPlace({
|
||||
trip_id: tid,
|
||||
name,
|
||||
lat: start?.[0] ?? place.lat ?? 0,
|
||||
lng: start?.[1] ?? place.lng ?? 0,
|
||||
lat: start[0],
|
||||
lng: start[1],
|
||||
route_geometry: place.route_geometry,
|
||||
description: place.description ?? null,
|
||||
website: place.website ?? null,
|
||||
|
||||
Reference in New Issue
Block a user