test(journey): the journal link repository on its own, without the two reads nothing called

linkRecipientUserIds and listTripIdsForJourney had no caller and kept src/db/repositories under its 99 % statement floor. TJLREPO-001..007 cover the link rows, the members list, the reach across trips ending with the membership, the hide-skeletons choice of a link member, the role precedence and leaveJournalLink.
This commit is contained in:
Maurice
2026-10-18 20:40:46 +02:00
parent 48d573c60d
commit ffa7333bb1
2 changed files with 174 additions and 20 deletions
@@ -213,24 +213,4 @@ export class TripJournalLinksRepository extends TrekRepository<TripJournalLinks>
.where('trip_id', '=', tripId)
.execute();
}
/** Everyone a journal's links let in, for its live updates. */
async linkRecipientUserIds(journeyId: number): Promise<number[]> {
const rows = await linkReach(this.kysely<TripJournalLinkKyselyDB>())
.select('m.user_id')
.distinct()
.where('l.journey_id', '=', journeyId)
.execute();
return rows.map((r) => r.user_id);
}
/** The trips that show this journal, for telling their members when it changes hands. */
async listTripIdsForJourney(journeyId: number): Promise<number[]> {
const rows = await this.kysely<TripJournalLinkKyselyDB>()
.selectFrom('trip_journal_links')
.select('trip_id')
.where('journey_id', '=', journeyId)
.execute();
return rows.map((r) => r.trip_id);
}
}