Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

1.7 KB
Raw Blame
import { Days } from '../../db/entities/Days.entity';
import { Reservations } from '../../db/entities/Reservations.entity';
import { AddonsModule } from '../addons/addons.module';
import { BudgetModule } from '../budget/budget.module';
import { LlmParseModule } from '../llm-parse/llm-parse.module';
import { MapsModule } from '../maps/maps.module';
import { McpSharedModule } from '../mcp-shared/mcp-shared.module';
import { PlacesModule } from '../places/places.module';
import { ReservationsModule } from '../reservations/reservations.module';
import { BookingImportService } from './booking-import.service';
import { ImportJobsService } from './import-jobs.service';
import { KitineraryExtractorModule } from './kitinerary-extractor.module';
import { MikroOrmModule } from '@mikro-orm/nestjs';
import { Module } from '@nestjs/common';

/**
 * `MikroOrmModule.forFeature([Days, Reservations])` (Plan 3h Task 4, BI1/BI2):
 * `BookingImportService.resolveDayId` reaches `DaysRepository.findByTripAndDate`
 * and `ReservationsRepository.findNearestDayId`; confirm() reads the duplicate
 * key through `ReservationsRepository`, and asks McpToolGuardsService whether
 * the importing person may edit the trip's bookings.
 */
@Module({
  imports: [
    KitineraryExtractorModule,
    LlmParseModule,
    ReservationsModule,
    McpSharedModule,
    BudgetModule,
    AddonsModule,
    MapsModule,
    PlacesModule,
    MikroOrmModule.forFeature([Days, Reservations]),
  ],
  providers: [BookingImportService, ImportJobsService],
  // The HTTP surface lives in reservation-import/, which shares the prefix with
  // the AirTrail import; these are what it needs.
  exports: [BookingImportService, ImportJobsService],
})
export class BookingImportModule {}