import { Global, Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { FleetEvent } from './entities/fleet-event.entity';
import { FleetHistoryService } from './fleet-history.service';

/**
 * Global so any fleet-touching service (vehicles, drivers, first/last-mile) can
 * inject FleetHistoryService to append audit events without each module having
 * to import this one.
 */
@Global()
@Module({
  imports: [TypeOrmModule.forFeature([FleetEvent])],
  providers: [FleetHistoryService],
  exports: [FleetHistoryService],
})
export class FleetHistoryModule {}
