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 { JwtStrategy } from '../owner/strategies/jwt.strategy';
import { DepartmentsController } from './departments.controller';
import { DepartmentsService } from './departments.service';

@Module({
  imports: [
    AccessControlModule,
    JwtModule.registerAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: jwtConfig,
    }),
  ],
  providers: [DepartmentsService, DatabaseService, JwtStrategy],
  controllers: [DepartmentsController],
})
export class DepartmentsModule {}
