From 652aa568e48dae15228045ee3ff4fc4c8b879199 Mon Sep 17 00:00:00 2001 From: jubnl Date: Thu, 24 Sep 2026 06:13:33 +0200 Subject: [PATCH] =?UTF-8?q?refactor(server):=20plan=204=20=E2=80=94=20trek?= =?UTF-8?q?-photos.repository.ts=20finishes=20its=20rename?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 3e Task 6 renamed the CLASS (TrekPhotosRepository -> TrekPhotoRegistrationService, since the name collided with the generated ORM TrekPhotos.repository.ts) but left the FILE and its test file's names unchanged. Renames both to trek-photo-registration.service.ts / .test.ts. The old path is kept as a thin re-export stub (the src/websocket.ts shape) rather than repointed at every one of its ~20 importers in this pass: several of those files sit in two sibling tasks' exclusively-owned windows on this shared branch (Task 3's budget/packing/todo/accommodations/places ripple, reached through tests/helpers/plugin-host.ts and mcp-test-controllers.ts; Task 5c's held-back tests/unit/services/{trekPhotoMedia,conflictUpdate}.test.ts) and are off limits here. Flagged for a follow-up once those tasks land: delete the stub and repoint every remaining importer at ./trek-photo-registration.service. --- .../photos/trek-photo-registration.service.ts | 9 +++++++++ .../src/nest/photos/trek-photos.repository.ts | 17 +++++++++++++++++ .../trek-photo-registration.service.test.ts | 9 +++++---- 3 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 server/src/nest/photos/trek-photos.repository.ts diff --git a/server/src/nest/photos/trek-photo-registration.service.ts b/server/src/nest/photos/trek-photo-registration.service.ts index 434b4dfbd..aed5d2af4 100644 --- a/server/src/nest/photos/trek-photo-registration.service.ts +++ b/server/src/nest/photos/trek-photo-registration.service.ts @@ -31,6 +31,15 @@ import type { JourneyPhotosRepository } from '../../db/repositories/JourneyPhoto * .repository.ts`, also `TrekPhotosRepository`, per the `EntityRepositoryType` * convention every entity in this program follows). Same shape as the 3d * §18.3 `ReservationsReadRepository` → `ReservationsReadService` precedent. + * + * File/test renamed to match (Plan 4 Task 8a — 3e Task 6 renamed only the + * class). The old path, `trek-photos.repository.ts`, is kept as a thin + * re-export stub (the same `src/websocket.ts` shape) rather than updated at + * every one of its ~20 importers in this pass: several of those files sit in + * two sibling tasks' exclusively-owned windows on this shared branch (Task + * 3's `nest/{budget,packing,todo,accommodations,places}/**` ripple and Task + * 5c's held-back test files) and are off limits here. The stub can be + * deleted and every importer repointed once those tasks land. */ @Injectable() export class TrekPhotoRegistrationService { diff --git a/server/src/nest/photos/trek-photos.repository.ts b/server/src/nest/photos/trek-photos.repository.ts new file mode 100644 index 000000000..afd7c266e --- /dev/null +++ b/server/src/nest/photos/trek-photos.repository.ts @@ -0,0 +1,17 @@ +/** + * Legacy re-export stub (the same shape `src/websocket.ts` is) — the real + * implementation moved to `trek-photo-registration.service.ts` (Plan 4 Task + * 8a: 3e Task 6 renamed the CLASS off `TrekPhotosRepository` because it + * collided with the generated ORM `TrekPhotos.repository.ts`, but left the + * FILE and test names unchanged; this finishes that rename). + * + * Kept here only because several importers of this path currently sit in + * two sibling tasks' exclusively-owned file windows on this shared branch + * (Task 3's `nest/{budget,packing,todo,accommodations,places}/**` ripple, + * which reaches this file through `tests/helpers/plugin-host.ts` and + * `mcp-test-controllers.ts`; Task 5c's held-back + * `tests/unit/services/{trekPhotoMedia,conflictUpdate}.test.ts`) and cannot + * be edited here. Delete this stub and repoint every remaining importer at + * `./trek-photo-registration.service` once those tasks land. + */ +export { TrekPhotoRegistrationService } from './trek-photo-registration.service'; diff --git a/server/tests/unit/nest/trek-photo-registration.service.test.ts b/server/tests/unit/nest/trek-photo-registration.service.test.ts index e655bb268..77db1d8a9 100644 --- a/server/tests/unit/nest/trek-photo-registration.service.test.ts +++ b/server/tests/unit/nest/trek-photo-registration.service.test.ts @@ -1,7 +1,8 @@ /** - * TrekPhotoRegistrationService (renamed from `TrekPhotosRepository`, Plan 3e - * R13 — collided with the generated ORM `TrekPhotos.repository.ts`) — PH1-11, - * now onto `TrekPhotosRepository`/`TripPhotosRepository` (the ORM ones). + * TrekPhotoRegistrationService (class renamed from `TrekPhotosRepository`, + * Plan 3e R13 — collided with the generated ORM `TrekPhotos.repository.ts`; + * file/test renamed to match, Plan 4 Task 8a) — PH1-11, now onto + * `TrekPhotosRepository`/`TripPhotosRepository` (the ORM ones). * * The three sources of a photo's "when and where" disagree in how much they * know: a provider search answers with coordinates, the same provider's @@ -15,7 +16,7 @@ import { resetTestDb } from '../../helpers/test-db'; import { createTestOrm, type TestOrm } from '../../helpers/test-orm'; import { createUser, createTrip } from '../../helpers/factories'; import { DatabaseService } from '../../../src/nest/database/database.service'; -import { TrekPhotoRegistrationService } from '../../../src/nest/photos/trek-photos.repository'; +import { TrekPhotoRegistrationService } from '../../../src/nest/photos/trek-photo-registration.service'; import { TrekPhotos } from '../../../src/db/entities/TrekPhotos.entity'; import { TripPhotos } from '../../../src/db/entities/TripPhotos.entity'; import { JourneyPhotos } from '../../../src/db/entities/JourneyPhotos.entity';