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:
jubnl
2026-07-29 01:53:54 +02:00
parent 530c7cb005
commit 287dceb532
18 changed files with 179 additions and 1370 deletions
+10 -17
View File
@@ -7,15 +7,16 @@ import { ExchangeRatesService } from './exchange-rates.service';
/**
* Non-Nest entry point for the budget domain — for code running OUTSIDE the
* Nest container (the legacy services/tripService.ts and
* services/userCleanupService.ts, and the legacy update_trip / create_transport
* registrars in src/mcp/tools/trips.ts and src/mcp/tools/transports.ts; the
* budget MCP tools and resources moved to the DI-discovered budget.mcp.ts, and
* the plugin RPC host injects BudgetService via PluginHostDepsFactory).
* Exports only the legacy services/budgetService names still consumed outside
* the container, 1:1, so repointing a consumer is an import-path-only diff.
* Inside the container, inject BudgetService instead. Delete this file when
* tripService/userCleanupService and the legacy MCP registrars migrate.
* Nest container (services/userCleanupService.ts and the legacy
* create_transport registrar in src/mcp/tools/transports.ts; the budget MCP
* tools and resources moved to the DI-discovered budget.mcp.ts, the plugin
* RPC host injects BudgetService via PluginHostDepsFactory, and the trip
* domain folded into the DI-native TripsService, which injects BudgetService —
* its bridge exports were pruned with it). Exports only the legacy
* services/budgetService names still consumed outside the container, 1:1, so
* repointing a consumer is an import-path-only diff. Inside the container,
* inject BudgetService instead. Delete this file when
* userCleanupService and the transports registrar migrate.
*
* Module-level construction is safe: `db` is the reinitialize-proof Proxy onto
* the shared better-sqlite3 singleton, and ExchangeRatesService keeps its FX
@@ -24,18 +25,10 @@ import { ExchangeRatesService } from './exchange-rates.service';
*/
const budget = new BudgetService(new DatabaseService(db), new PermissionsService(new DatabaseService(db)), new ExchangeRatesService(), new RealtimeService());
export function listBudgetItems(tripId: string | number) {
return budget.listBudgetItems(tripId);
}
export function removeUserFromBudgetItems(userId: number): void {
budget.removeUserFromBudgetItems(userId);
}
export function rebaseTripCurrency(tripId: string | number, newCurrency: string | null | undefined): Promise<void> {
return budget.rebaseTripCurrency(tripId, newCurrency);
}
export function linkBudgetItemToReservation(
tripId: string | number,
reservationId: number,