import { Module } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';
import { UsersModule } from '../users/users.module';
import { SettingsModule } from '../settings/settings.module';
import { Punch, PunchSchema } from '../punches/schemas/punch.schema';
import { GpsPoint, GpsPointSchema } from '../gps/schemas/gps-point.schema';
import { GpsStop, GpsStopSchema } from '../gps/schemas/gps-stop.schema';
import {
  TrackingEvent,
  TrackingEventSchema,
} from '../tracking/schemas/tracking-event.schema';
import {
  TrackingCoverageSnapshot,
  TrackingCoverageSnapshotSchema,
} from '../tracking/schemas/tracking-coverage-snapshot.schema';
import { Trip, TripSchema } from './schemas/trip.schema';
import { TripsController } from './trips.controller';
import { TripsService } from './trips.service';

@Module({
  imports: [
    MongooseModule.forFeature([
      { name: Trip.name, schema: TripSchema },
      { name: Punch.name, schema: PunchSchema },
      { name: GpsPoint.name, schema: GpsPointSchema },
      { name: GpsStop.name, schema: GpsStopSchema },
      { name: TrackingEvent.name, schema: TrackingEventSchema },
      {
        name: TrackingCoverageSnapshot.name,
        schema: TrackingCoverageSnapshotSchema,
      },
    ]),
    UsersModule,
    SettingsModule,
  ],
  controllers: [TripsController],
  providers: [TripsService],
  exports: [TripsService],
})
export class TripsModule {}
