import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { Character } from '../characters/entities/character.entity';
import { LocationConnection } from '../world/entities/location-connection.entity';
import { LocationDefinition } from '../world/entities/location-definition.entity';
import { CLOCK, systemClock } from './clock';
import { Travel } from './entities/travel.entity';
import { TravelController } from './travel.controller';
import { TravelService } from './travel.service';

@Module({
  imports: [
    TypeOrmModule.forFeature([
      Character,
      LocationDefinition,
      LocationConnection,
      Travel,
    ]),
  ],
  controllers: [TravelController],
  providers: [TravelService, { provide: CLOCK, useValue: systemClock }],
  exports: [TravelService],
})
export class TravelModule {}
