dependencies Legend  Declarations  Module  Bootstrap  Providers  Exports cluster_UsersModule cluster_UsersModule_providers cluster_UsersModule_imports cluster_UsersModule_exports DatabaseModule DatabaseModule UsersModule UsersModule DatabaseModule->UsersModule UsersService UsersService UsersModule->UsersService GetUserByIdUseCase GetUserByIdUseCase GetUserByIdUseCase->UsersModule UsersService UsersService UsersService->UsersModule

File

libs/users/interface-adapters/src/lib/users.module.ts

import { Module } from '@nestjs/common';
import { DatabaseModule } from '@shared/infrastructure-mongoose';
import {
  UsersService,
  GetUserByIdUseCase,

} from '@users/application';
import {
  MongooseUsersRepository,
  UserDocument,
  UserSchema,
} from '@users/infrastructure-mongoose';
import { MongooseModule } from '@nestjs/mongoose';
import { USERS_REPOSITORY } from '@users/domain';

import { UsersResolver } from './resolver/users.resolver';

@Module({
  providers: [
    UsersResolver,
    UsersService,
    GetUserByIdUseCase,
    {
      provide: USERS_REPOSITORY,
      useClass: MongooseUsersRepository,
    },
  ],
  imports: [
    DatabaseModule,
    MongooseModule.forFeature([
      { name: UserDocument.name, schema: UserSchema },
    ]),
  ],
  exports: [UsersService],
})
export class UsersModule {}

results matching ""

    No results matching ""