/*
https://docs.nestjs.com/modules
*/

import { Module } from '@nestjs/common';
import { AuthController } from './auth.controller';
import { AuthService } from './auth.service';
import { UserModule } from '../user/user.module';
import { UserService } from '../user/user.service';
import { LocalStrategy } from '../../../../libs/auth-core-lib/src/strategies/local.strategy';
import { JwtModule } from '@nestjs/jwt';
import { JwtStrategy } from '../../../../libs/auth-core-lib/src/strategies/jwt-strategy';
import { TypeOrmModule } from '@nestjs/typeorm';
import { User } from '../user/user.entity';
import { ConfigModule } from '@nestjs/config';
import { Marchantuser } from '../merchantuser/merchantuser.entity';
import { MerchantuserModule } from '../merchantuser/merchantuser.module';
import { TypeOrmSharedModule } from '@app/typeorm';
import { AuthCoreLibModule } from 'libs/auth-core-lib/src/auth-core-lib.module';
import { SmsTemplateModule } from '../sms-template/sms-template.module';
import { SmsHistoryModule } from '../sms-history/sms-history.module';
import { BlacklistModule } from '../blacklist/blacklist.module';
import { BlacklistlogModule } from '../blacklistlog/blacklistlog.module';
import { DefaultcreaditlimitModule } from '../defaultcreaditlimit/defaultcreaditlimit.module';

@Module({
  imports: [
    UserModule,
    MerchantuserModule,
    ConfigModule.forRoot(),
    TypeOrmSharedModule,
    JwtModule.register({
      secret: 'isuru-chandika-rathnayaka',
      signOptions: { expiresIn: '1d' },
    }),
    TypeOrmModule.forFeature([User, Marchantuser]),
    AuthCoreLibModule,
    SmsTemplateModule,
    SmsHistoryModule,
    BlacklistModule,
    BlacklistlogModule,
    DefaultcreaditlimitModule,
  ],
  controllers: [AuthController],
  providers: [AuthService, LocalStrategy, JwtStrategy],
})
export class AuthModule {}
