feat(tours): add non-motorized day tour planning

This commit is contained in:
elmocito
2026-10-04 12:59:55 +02:00
parent c93cf2bce9
commit 9e475f447a
202 changed files with 16129 additions and 383 deletions
+3 -2
View File
@@ -19,6 +19,7 @@ const FIXTURES: Record<TrekWsEventName, Record<string, unknown>> = {
'place:created': { place: { id: 3, name: 'Louvre' } },
'place:updated': { place: { id: 3, name: 'Louvre' } },
'place:deleted': { placeId: 3 },
'tours:changed': { placeIds: [3] },
'assignment:created': { assignment: { id: 9, day_id: 2 } },
'assignment:updated': { assignment: { id: 9, day_id: 2 } },
'assignment:deleted': { assignmentId: 9, dayId: 2 },
@@ -153,9 +154,9 @@ describe('@trek/shared realtime event registry', () => {
// panel without every member polling for it.
// 33rd user event: journey:photos:updated, so the gallery re-sorts once the
// capture times of an import have landed (#1587).
expect(TREK_WS_TRIP_EVENT_NAMES).toHaveLength(74);
expect(TREK_WS_TRIP_EVENT_NAMES).toHaveLength(75);
expect(TREK_WS_USER_EVENT_NAMES).toHaveLength(33);
expect(TREK_WS_EVENT_NAMES).toHaveLength(107);
expect(TREK_WS_EVENT_NAMES).toHaveLength(108);
});
it('WSEVT-REG-002: every name is domain:action shaped and outside the reserved plugin: namespace', () => {
+2
View File
@@ -63,6 +63,8 @@ export const TREK_WS_EVENTS = {
'place:created': { scope: 'trip', payload: z.object({ place: entity }) },
'place:updated': { scope: 'trip', payload: z.object({ place: entity }) },
'place:deleted': { scope: 'trip', payload: z.object({ placeId: id }) },
// Invalidate the trip's Tours list; affected ids let peers exclude new Tours immediately.
'tours:changed': { scope: 'trip', payload: z.object({ placeIds: idList.optional() }) },
// ── Assignments ──────────────────────────────────────────────────────────
'assignment:created': { scope: 'trip', payload: z.object({ assignment: entity }) },