rwadurian/backend/services/auth-service/src/application/application.module.ts

53 lines
1.2 KiB
TypeScript

import { Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { ScheduleModule } from '@nestjs/schedule';
import {
AuthService,
PasswordService,
SmsService,
KycService,
UserService,
OutboxService,
AdminSyncService,
} from './services';
import { OutboxScheduler } from './schedulers';
import { InfrastructureModule } from '@/infrastructure/infrastructure.module';
@Module({
imports: [
InfrastructureModule,
ScheduleModule.forRoot(),
JwtModule.registerAsync({
imports: [ConfigModule],
useFactory: (configService: ConfigService) => ({
secret: configService.get<string>('JWT_SECRET'),
signOptions: {
expiresIn: configService.get<string>('JWT_EXPIRES_IN', '7d'),
},
}),
inject: [ConfigService],
}),
],
providers: [
AuthService,
PasswordService,
SmsService,
KycService,
UserService,
OutboxService,
AdminSyncService,
OutboxScheduler,
],
exports: [
AuthService,
PasswordService,
SmsService,
KycService,
UserService,
AdminSyncService,
OutboxService,
],
})
export class ApplicationModule {}