import { Module, forwardRef } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';

import { BillingModule } from '../billing/billing.module';
import { BookingsModule } from '../bookings/bookings.module';
import { FilesModule } from '../files/files.module';
import { DriversModule } from '../drivers/drivers.module';
import { NotificationsModule } from '../notifications/notifications.module';
import { VehiclesModule } from '../vehicles/vehicles.module';
import { LastMile } from './entities/last-mile.entity';
import { LastMileContainerAllocation } from './entities/last-mile-container-allocation.entity';
import { LastMileVehicleAssignment } from './entities/last-mile-vehicle-assignment.entity';
import { LastMileVehicleContainer } from './entities/last-mile-vehicle-container.entity';
import { LastMileController } from './last-mile.controller';
import { LastMileInvoiceService } from './last-mile-invoice.service';
import { LastMileRepository } from './last-mile.repository';
import { LastMileService } from './last-mile.service';

@Module({
  imports: [
    TypeOrmModule.forFeature([
      LastMile,
      LastMileContainerAllocation,
      LastMileVehicleAssignment,
      LastMileVehicleContainer,
    ]),
    BillingModule,
    forwardRef(() => BookingsModule),
    VehiclesModule,
    DriversModule,
    NotificationsModule,
    FilesModule,
  ],
  controllers: [LastMileController],
  providers: [LastMileRepository, LastMileService, LastMileInvoiceService],
  exports: [LastMileRepository, LastMileService, LastMileInvoiceService],
})
export class LastMileModule {}
