diff --git a/libs/prisma/src/prisma.module.ts b/libs/prisma/src/prisma.module.ts index ec0ce32..be9471f 100644 --- a/libs/prisma/src/prisma.module.ts +++ b/libs/prisma/src/prisma.module.ts @@ -1,5 +1,12 @@ +import { READ_ENTIRE_PROCESS } from '@autocrud/skeleton'; import { Module } from '@nestjs/common'; import { PrismaService } from './prisma.service'; +import { PrismaListProcess } from './processes/list.process'; + +export const configServiceProvider = { + provide: READ_ENTIRE_PROCESS, + useClass: PrismaListProcess, +}; @Module({ providers: [PrismaService], diff --git a/src/app.module.ts b/src/app.module.ts index 058b675..2ea893f 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -1,11 +1,12 @@ -import { PrismaModule, PrismaService } from '@autocrud/prisma'; +import { + configServiceProvider, + PrismaModule, + PrismaService, +} from '@autocrud/prisma'; import { PRISMA_DELEGATE } from '@autocrud/prisma/constants'; -import { ListProcess } from '@autocrud/skeleton/processes/list.process'; import { Module } from '@nestjs/common'; import { AppController } from './app.controller'; import { AppService } from './app.service'; -import { READ_ENTIRE_PROCESS } from '@autocrud/skeleton'; -import { PrismaListProcess } from '@autocrud/prisma/processes/list.process'; const customFactory = { provide: PRISMA_DELEGATE, @@ -16,13 +17,8 @@ const customFactory = { }; @Module({ - imports: [], + imports: [PrismaModule], controllers: [AppController], - providers: [ - AppService, - PrismaService, - customFactory, - { provide: READ_ENTIRE_PROCESS, useClass: PrismaListProcess }, - ], + providers: [AppService, customFactory, configServiceProvider], }) export class AppModule {}