import { Module } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';
import { GpsPoint, GpsPointSchema } from '../gps/schemas/gps-point.schema';
import { Punch, PunchSchema } from '../punches/schemas/punch.schema';
import { TripsModule } from '../trips/trips.module';
import { UsersModule } from '../users/users.module';
import {
  TrackingEvent,
  TrackingEventSchema,
} from './schemas/tracking-event.schema';
import {
  TrackingCoverageSnapshot,
  TrackingCoverageSnapshotSchema,
} from './schemas/tracking-coverage-snapshot.schema';
import { TrackingEventsService } from './tracking-events.service';
import { TrackingCoverageService } from './tracking-coverage.service';

@Module({
  imports: [
    MongooseModule.forFeature([
      { name: TrackingEvent.name, schema: TrackingEventSchema },
      {
        name: TrackingCoverageSnapshot.name,
        schema: TrackingCoverageSnapshotSchema,
      },
      { name: GpsPoint.name, schema: GpsPointSchema },
      { name: Punch.name, schema: PunchSchema },
    ]),
    TripsModule,
    UsersModule,
  ],
  providers: [TrackingEventsService, TrackingCoverageService],
  exports: [TrackingEventsService, TrackingCoverageService],
})
export class TrackingModule {}
