import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { Wagon } from './entities/wagon.entity';
import { WagonMovement } from './entities/wagon-movement.entity';
import { WagonTransferRequest } from './entities/wagon-transfer-request.entity';
import { Train } from '../trains/entities/train.entity';
import { Yard } from '../rule-engine/entities/yard.entity';
import { NotificationInboxModule } from '../notification-inbox/notification-inbox.module';
import { WagonsController } from './wagons.controller';
import { WagonTransferRequestsController } from './wagon-transfer-requests.controller';
import { WagonsService } from './wagons.service';
import { WagonTransferRequestsService } from './wagon-transfer-requests.service';

@Module({
  imports: [
    TypeOrmModule.forFeature([
      Wagon,
      WagonMovement,
      WagonTransferRequest,
      Train,
      Yard,
    ]),
    // The transfer desk notifies the requester as instalments land.
    NotificationInboxModule,
  ],
  controllers: [
    WagonsController,
    WagonTransferRequestsController,
  ],
  providers: [WagonsService, WagonTransferRequestsService],
  exports: [WagonsService, WagonTransferRequestsService],
})
export class WagonsModule {}
