feat(roadtrip): share trip preferences and improve service stops

This commit is contained in:
Maurice
2026-09-12 00:24:45 +02:00
parent dd6ad31ab9
commit b773faff70
72 changed files with 1136 additions and 375 deletions
+3 -3
View File
@@ -144,11 +144,11 @@ const DRIFT_VARIANTS: Partial<Record<TrekWsEventName, Record<string, unknown>[]>
};
describe('@trek/shared realtime event registry', () => {
it('WSEVT-REG-001: pins the authoritative inventory counts (72 trip + 33 user = 105)', () => {
it('WSEVT-REG-001: pins the authoritative inventory counts (73 trip + 32 user = 105)', () => {
// 67th to 69th trip event: the three collab:link:* a shared link emits.
// 70th and 71st: the road trip's vias and tracks, which used to be written silently.
expect(TREK_WS_TRIP_EVENT_NAMES).toHaveLength(72);
expect(TREK_WS_USER_EVENT_NAMES).toHaveLength(33);
expect(TREK_WS_TRIP_EVENT_NAMES).toHaveLength(73);
expect(TREK_WS_USER_EVENT_NAMES).toHaveLength(32);
expect(TREK_WS_EVENT_NAMES).toHaveLength(105);
});
+2 -1
View File
@@ -258,8 +258,9 @@ export const TREK_WS_EVENTS = {
// ── Memories ─────────────────────────────────────────────────────────────
'memories:updated': { scope: 'trip', payload: z.object({ userId: id }) },
'roadtripPreferences:changed': { scope: 'trip', payload: z.object({ preferences: roadtripPreferencesSchema }) },
// ── Notifications (user-scoped) ──────────────────────────────────────────
'roadtripPreferences:changed': { scope: 'user', payload: z.object({ preferences: roadtripPreferencesSchema }) },
'notification:new': { scope: 'user', payload: z.object({ notification: entity }) },
'notification:updated': { scope: 'user', payload: z.object({ notification: entity }) },