refactor(trips): the member departure port in common/, where both sides may import it

Declared in trip-members, the port gave journey an edge into the roster, which reaches journey through other domains: the cycle again, the other way round. In the shared kernel neither domain owns it.
This commit is contained in:
Maurice
2026-10-18 18:44:02 +02:00
parent ce8d1e5a0a
commit a6da69ee36
5 changed files with 6 additions and 8 deletions
@@ -3,7 +3,8 @@
*
* A port rather than the journal link service itself: the journey domain
* already depends on the trip roster through others, so reaching into it from
* here closed a cycle. The journey domain binds the token
* the roster closed a cycle. It lives in common/ because either domain owning
* it would draw that edge again. The journey domain binds the token
* (TripMemberDepartureModule), and the roster calls it inside the transaction
* that removes the member.
*/
@@ -4,10 +4,10 @@ import type { JourneyContributorsRepository } from '../../db/repositories/Journe
import type { TripJournalLinksRepository, TripPersonRow } from '../../db/repositories/TripJournalLinks.repository';
import { avatarUrl } from '../common/avatarUrl';
import { forbidden, notFound } from '../common/domain-error';
import type { TripMemberDeparture } from '../common/trip-member-departure.types';
import { UnitOfWork } from '../database/unit-of-work';
import { PermissionsService } from '../permissions/permissions.service';
import { RealtimeService } from '../realtime/realtime.service';
import type { TripMemberDeparture } from '../trip-members/trip-member-departure.types';
import { TripAccessService } from '../trip-membership/trip-access.service';
import { JourneyDomainService } from './journey-domain.service';
import { InjectRepository } from '@mikro-orm/nestjs';
@@ -1,4 +1,4 @@
import { TRIP_MEMBER_DEPARTURE } from '../trip-members/trip-member-departure.types';
import { TRIP_MEMBER_DEPARTURE } from '../common/trip-member-departure.types';
import { TripJournalLinkModule } from './trip-journal-link.module';
import { TripJournalLinkService } from './trip-journal-link.service';
import { Global, Module } from '@nestjs/common';
@@ -10,11 +10,11 @@ import { UserCleanupService } from '../auth/user-cleanup.service';
import { BudgetService } from '../budget/budget.service';
import { avatarUrl } from '../common/avatarUrl';
import { NotFoundError, ValidationError } from '../common/domain-errors';
import { TRIP_MEMBER_DEPARTURE, type TripMemberDeparture } from '../common/trip-member-departure.types';
import { UnitOfWork } from '../database/unit-of-work';
import { NotificationsService } from '../notifications/notifications.service';
import { PermissionsService } from '../permissions/permissions.service';
import { RealtimeService } from '../realtime/realtime.service';
import { TRIP_MEMBER_DEPARTURE, type TripMemberDeparture } from './trip-member-departure.types';
import { InjectRepository } from '@mikro-orm/nestjs';
import { Inject, Injectable } from '@nestjs/common';
import type { TrekWsPayload, TrekWsTripEventName } from '@trek/shared';
+1 -4
View File
@@ -2,10 +2,7 @@ import { JourneyBooks } from '../../src/db/entities/JourneyBooks.entity';
import { JourneyShareTokens } from '../../src/db/entities/JourneyShareTokens.entity';
import type { JourneyBooksRepository } from '../../src/db/repositories/JourneyBooks.repository';
import type { JourneyShareTokensRepository } from '../../src/db/repositories/JourneyShareTokens.repository';
import {
TRIP_MEMBER_DEPARTURE,
type TripMemberDeparture,
} from '../../src/nest/trip-members/trip-member-departure.types';
import { TRIP_MEMBER_DEPARTURE, type TripMemberDeparture } from '../../src/nest/common/trip-member-departure.types';
import { sharedTestOrm } from './test-uow';
import { Global, Module } from '@nestjs/common';