-
Marlène SIMONDANT authoredMarlène SIMONDANT authored
users.module.ts 2.51 KiB
import { HttpModule } from '@nestjs/axios';
import { forwardRef, Module } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';
import { UsersService } from './services/users.service';
import { UsersController } from './controllers/users.controller';
import { User, UserSchema } from './schemas/user.schema';
import { MailerModule } from '../mailer/mailer.module';
import { StructuresModule } from '../structures/structures.module';
import { TempUserModule } from '../temp-user/temp-user.module';
import { JobsController } from './controllers/jobs.controller';
import { JobsGroupsController } from './controllers/jobsGroups.controller';
import { EmployerController } from './controllers/employer.controller';
import { EmployerService } from './services/employer.service';
import { JobsService } from './services/jobs.service';
import { JobsGroupsService } from './services/jobsGroups.service';
import { Job, JobSchema } from './schemas/job.schema';
import { JobsGroups, JobsGroupsSchema } from './schemas/jobsGroups.schema';
import { Employer, EmployerSchema } from './schemas/employer.schema';
import { EmployerSearchService } from './services/employer-search.service';
import { SearchModule } from '../search/search.module';
import { UsersRegistryController } from './controllers/userRegistry.controller';
import { UserRegistryService } from './services/userRegistry.service';
import { UserRegistrySearchService } from './services/userRegistry-search.service';
import { JwtModule } from '@nestjs/jwt';
import { config } from 'dotenv';
config();
@Module({
imports: [
MongooseModule.forFeature([
{ name: User.name, schema: UserSchema },
{ name: Job.name, schema: JobSchema },
{ name: JobsGroups.name, schema: JobsGroupsSchema },
{ name: Employer.name, schema: EmployerSchema },
]),
MailerModule,
forwardRef(() => StructuresModule),
HttpModule,
TempUserModule,
SearchModule,
JwtModule.register({
secret: process.env.JWT_SECRET,
signOptions: { expiresIn: '30d' }, // 1 month validity
}),
],
providers: [
UsersService,
JobsService,
JobsGroupsService,
EmployerSearchService,
EmployerService,
UserRegistryService,
UserRegistrySearchService,
],
exports: [
UsersService,
JobsService,
JobsGroupsService,
EmployerService,
UserRegistryService,
UserRegistrySearchService,
],
controllers: [UsersController, JobsController, JobsGroupsController, EmployerController, UsersRegistryController],
})
export class UsersModule {}