Appearance
Use Cases
A use case is a specific functionality that the application provides. This can be exposed through a controller to the outside world. Or it can be used internally by other use cases, jobs, cronjobs, etc.
Module
We create a module in each use case folder to keep the codebase clean and organized. This module imports the necessary dependencies for the use case.
typescript
@Module({
imports: [
TypeOrmModule.forFeature([User]),
],
controllers: [GetUserController],
providers: [GetUserUseCase],
exports: []
})
export class GetUserModule {}
Components
The files that you will typically find in your use-case folder.