mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
chore: wire TripsService into the plugin RPC host and retire the legacy tripService
Swap the factory's six tripService imports for the injected TripsService; delete services/tripService.ts and the collab/vacay bridges with it; prune the days/budget bridges to their surviving exports; update the migration docs and regenerate migration-graph.md.
This commit is contained in:
@@ -35,14 +35,14 @@ import { createUser } from '../../helpers/factories';
|
||||
|
||||
import { DatabaseService } from '../../../src/nest/database/database.service';
|
||||
import { VacayService } from '../../../src/nest/vacay/vacay.service';
|
||||
import { shiftOwnerEntriesForTripWindow } from '../../../src/nest/vacay/vacay.bridge';
|
||||
import { RealtimeService } from '../../../src/nest/realtime/realtime.service';
|
||||
|
||||
// VACAY-SVC-001 through VACAY-SVC-066 moved 1:1 from the legacy
|
||||
// tests/unit/services/vacayService.test.ts (the named-function imports became
|
||||
// method calls on a directly constructed VacayService; the legacy
|
||||
// updateUserYearSettings is the class's updateYearSettings). VACAY-SVC-067
|
||||
// pins the vacay.bridge delegation for the one outside-container consumer.
|
||||
// updateUserYearSettings is the class's updateYearSettings).
|
||||
// VACAY-SVC-067 (vacay.bridge delegation) died with the bridge — its only
|
||||
// consumer, the legacy tripService, folded into the DI-native TripsService.
|
||||
const svc = new VacayService(new DatabaseService(testDb), new RealtimeService());
|
||||
|
||||
// ── Lifecycle ─────────────────────────────────────────────────────────────────
|
||||
@@ -1367,20 +1367,6 @@ describe('getSharedCalendars', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// ── vacay.bridge delegation ───────────────────────────────────────────────────
|
||||
|
||||
describe('vacay.bridge', () => {
|
||||
it('VACAY-SVC-067: shiftOwnerEntriesForTripWindow shifts the owner entries through the bridge', () => {
|
||||
const { user, plan } = setupUserWithPlan();
|
||||
svc.toggleEntry(user.id, plan.id, '2025-05-10', 1);
|
||||
|
||||
shiftOwnerEntriesForTripWindow(user.id, '2025-05-08', '2025-05-12', '2025-05-15');
|
||||
|
||||
const dates = testDb.prepare('SELECT date FROM vacay_entries WHERE plan_id = ? ORDER BY date').all(plan.id);
|
||||
expect(dates).toEqual([{ date: '2025-05-17' }]);
|
||||
});
|
||||
});
|
||||
|
||||
// ── Quirk fixes (transactions, fetch hygiene, cache TTL, addYear errors) ──────
|
||||
|
||||
describe('quirk fixes', () => {
|
||||
|
||||
Reference in New Issue
Block a user