mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-05 10:24:05 +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:
@@ -1,28 +0,0 @@
|
||||
import { db } from '../../db/database';
|
||||
import { DatabaseService } from '../database/database.service';
|
||||
import { RealtimeService } from '../realtime/realtime.service';
|
||||
import { VacayService } from './vacay.service';
|
||||
|
||||
/**
|
||||
* Non-Nest entry point for the vacay domain — for code running OUTSIDE the
|
||||
* Nest container (the legacy services/tripService.ts, which shifts a trip
|
||||
* owner's vacation entries when the trip window moves; the vacay MCP tools and
|
||||
* resources moved to the DI-discovered vacay.mcp.ts, and the plugin RPC host
|
||||
* injects VacayService via PluginHostDepsFactory). Exports only the legacy
|
||||
* services/vacayService names still consumed outside the container, 1:1, so
|
||||
* repointing a consumer is an import-path-only diff. Inside the container,
|
||||
* inject VacayService instead. Delete this file when tripService migrates.
|
||||
*
|
||||
* Module-level construction is safe: `db` is the reinitialize-proof Proxy onto
|
||||
* the shared better-sqlite3 singleton.
|
||||
*/
|
||||
const vacay = new VacayService(new DatabaseService(db), new RealtimeService());
|
||||
|
||||
export function shiftOwnerEntriesForTripWindow(
|
||||
ownerId: number,
|
||||
oldStart: string,
|
||||
oldEnd: string,
|
||||
newStart: string
|
||||
): void {
|
||||
return vacay.shiftOwnerEntriesForTripWindow(ownerId, oldStart, oldEnd, newStart);
|
||||
}
|
||||
@@ -155,8 +155,9 @@ function windowEndYear(end: string): number {
|
||||
* an AbortSignal timeout and the nager.at responses are ok-checked;
|
||||
* applyHolidayCalendars honors the cache TTL; addYear no longer swallows real
|
||||
* errors; the holiday cache is instance state instead of a module-level map.
|
||||
* The only consumer outside the Nest container is the legacy tripService,
|
||||
* which goes through vacay.bridge.ts instead of importing this class.
|
||||
* All consumers are in-container since the trip fold (TripsService injects
|
||||
* this class); vacay.bridge.ts was deleted with its last outside-container
|
||||
* consumer.
|
||||
*/
|
||||
@Injectable()
|
||||
export class VacayService {
|
||||
|
||||
Reference in New Issue
Block a user