feat(journey): the journal settings list who a linked trip lets in

Under the contributors, the journey settings on desktop and phone get a section of their own, Through trips, with everyone a trip's journal link lets in, their role and the trip they come through. It is read only there, since the trip's settings manage it, and it leaves out whoever is a contributor already. getJourneyFull answers it as trip_access.
This commit is contained in:
Maurice
2026-10-18 22:04:41 +02:00
parent 451167bde3
commit 532010aa79
35 changed files with 248 additions and 12 deletions
@@ -171,4 +171,21 @@ describe('TripJournalLinksRepository', () => {
expect(await links.findForTrip(s.trip.id)).toBeNull();
expect(await links.listMembers(s.trip.id)).toEqual([]);
});
it('TJLREPO-008: the journal lists who the links let in, per trip, apart from its contributors', async () => {
const s = await scene();
await links.upsertLink(s.trip.id, s.journal.id, s.owner.id, 1);
await links.replaceMembers(
s.trip.id,
[
{ user_id: s.tom.id, role: 'editor' },
{ user_id: s.lena.id, role: 'viewer' },
],
1,
);
await addJourneyContributor(t, s.journal.id, s.tom.id, 'viewer');
const access = await contributors.listTripAccessForJourney(s.journal.id);
expect(access.map((a) => [a.username, a.role, a.trip_id])).toEqual([['Lena', 'viewer', s.trip.id]]);
expect(access[0]?.trip_title).toBe(s.trip.title);
});
});