mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-05 18:34:09 +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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user