import { forwardRef, Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { BookingsModule } from '../bookings/bookings.module';
import { CompaniesModule } from '../companies/companies.module';
import { DropdownSettingsModule } from '../dropdown-settings/dropdown-settings.module';
import { RuleEngineModule } from '../rule-engine/rule-engine.module';
import { TrainSchedulingModule } from '../train-scheduling/train-scheduling.module';
import { BookingOrdersController } from './booking-orders.controller';
import { BookingOrdersRepository } from './booking-orders.repository';
import { BookingOrdersService } from './booking-orders.service';
import { BookingOrder } from './entities/booking-order.entity';
import { BookingOrderLine } from './entities/booking-order-line.entity';
import { ContractRouteLine } from './entities/contract-route-line.entity';
import { GeneralContractService } from './general-contract.service';

@Module({
  imports: [
    TypeOrmModule.forFeature([BookingOrder, BookingOrderLine, ContractRouteLine]),
    BookingsModule,
    CompaniesModule,
    DropdownSettingsModule,
    RuleEngineModule,
    forwardRef(() => TrainSchedulingModule),
  ],
  controllers: [BookingOrdersController],
  providers: [
    BookingOrdersService,
    BookingOrdersRepository,
    GeneralContractService,
  ],
  exports: [BookingOrdersService, GeneralContractService],
})
export class BookingOrdersModule {}
