import { Module } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';
import { GpsPoint, GpsPointSchema } from '../gps/schemas/gps-point.schema';
import { TripsModule } from '../trips/trips.module';
import { DirectionsController } from './directions.controller';
import { GoogleDirectionsClient } from './google-directions.client';
import { GoogleRoadsClient } from './google-roads.client';
import { MapMatchingService } from './map-matching.service';
import { PathAlignService } from './path-align.service';
import { MatchJob, MatchJobSchema } from './schemas/match-job.schema';
import { RouteSegment, RouteSegmentSchema } from './schemas/route-segment.schema';

@Module({
  imports: [
    MongooseModule.forFeature([
      { name: GpsPoint.name, schema: GpsPointSchema },
      { name: RouteSegment.name, schema: RouteSegmentSchema },
      { name: MatchJob.name, schema: MatchJobSchema },
    ]),
    TripsModule,
  ],
  controllers: [DirectionsController],
  providers: [
    GoogleRoadsClient,
    GoogleDirectionsClient,
    PathAlignService,
    MapMatchingService,
  ],
  exports: [
    MapMatchingService,
    GoogleRoadsClient,
    GoogleDirectionsClient,
    PathAlignService,
  ],
})
export class MapMatchingModule {}
