import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { JwtModule } from '@nestjs/jwt';
import { jwtConfig, DatabaseService } from '../../config';
import { AccessControlModule } from '../access-control/access-control.module';
import { DevicesModule } from '../devices/devices.module';
import { IpWhitelistModule } from '../ip-whitelist/ip-whitelist.module';
import { JwtStrategy } from '../owner/strategies/jwt.strategy';
import { AttendanceController } from './attendance.controller';
import { AttendanceService } from './attendance.service';

@Module({
  imports: [
    AccessControlModule,
    IpWhitelistModule,
    DevicesModule,
    JwtModule.registerAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: jwtConfig,
    }),
  ],
  controllers: [AttendanceController],
  providers: [AttendanceService, DatabaseService, JwtStrategy],
  exports: [AttendanceService],
})
export class AttendanceModule {}

