mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-27 07:07:31 +00:00
fix(mcp): keep transit out of the transport create enum
The transport form's picker has nine entries, not ten: a transit booking carries a provider itinerary in metadata.transit and create_transit_journey is what writes one, so letting a caller hand-make a bare transit row produces a shape the transit UI does not expect. Splits the one list in two - what may be asked for, and what counts as a transport for the update gate - so a stored transit booking stays editable through update_transport, which is where it was already reachable. Also reports the ids set_reservation_travelers dropped instead of returning a plain success with a shorter list.
This commit is contained in:
@@ -592,6 +592,23 @@ describe('Tool: set_reservation_travelers', () => {
|
||||
});
|
||||
const data = parseToolResult(result) as any;
|
||||
expect(data.travelers.map((t: any) => t.user_id)).toEqual([owner.id]);
|
||||
// A caller that guessed an id for a name it could not resolve is told so
|
||||
// rather than getting a plain success with a shorter list.
|
||||
expect(data.ignored_user_ids).toEqual([outsider.id]);
|
||||
});
|
||||
});
|
||||
|
||||
it('says nothing about ignored ids when every id was on the trip', async () => {
|
||||
const { user: owner } = createUser(testDb);
|
||||
const trip = createTrip(testDb, owner.id);
|
||||
await withHarness(owner.id, async (h) => {
|
||||
const reservationId = await makeBooking(h, trip.id);
|
||||
const result = await h.client.callTool({
|
||||
name: 'set_reservation_travelers',
|
||||
arguments: { tripId: trip.id, reservationId, user_ids: [owner.id] },
|
||||
});
|
||||
const data = parseToolResult(result) as any;
|
||||
expect(data.ignored_user_ids).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user