Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix(tours): point undo_tour_change at the revision prepare_tour_undo returns

Mauriceb177daea3ceb
diff --git a/shared/src/tours/tour-change.schema.spec.ts b/shared/src/tours/tour-change.schema.spec.ts
index f1c2d4943..389d22b62 100644
--- a/shared/src/tours/tour-change.schema.spec.ts
+++ b/shared/src/tours/tour-change.schema.spec.ts
@@ -74,6 +74,11 @@ describe('a prepared change the traveller confirmed, sent to be saved (MCP-T03)'
describe('a saved step the traveller confirmed to take back (MCP-T04)', () => {
const undo = { step_id: 7, expected_revision: 4, confirmed: true };
+ it('points the revision at the field prepare_tour_undo really returns', () => {
+ const field = tourChangeUndoRequestSchema.shape.expected_revision;
+ expect(field.description).toContain('undo.expected_revision of prepare_tour_undo');
+ });
+
it('takes the step, the revision it was shown at and the yes', () => {
expect(tourChangeUndoRequestSchema.parse(undo)).toEqual(undo);
});
diff --git a/shared/src/tours/tour-change.schema.ts b/shared/src/tours/tour-change.schema.ts
index 7820a48d1..3453503fa 100644
--- a/shared/src/tours/tour-change.schema.ts
+++ b/shared/src/tours/tour-change.schema.ts
@@ -86,7 +86,7 @@ export const tourChangeUndoRequestSchema = z
.object({
step_id: idSchema.describe('The id of the saved step, as list_tour_change_steps gives it'),
expected_revision: tourRevisionSchema.describe(
- 'now.revision of the preview: the revision of the tour the step was shown to be taken back from',
+ 'undo.expected_revision of prepare_tour_undo: the revision of the tour the step was shown to be taken back from',
),
confirmed: z
.literal(true)