From 28347d0bfea07abe6d7f8afc9bb36f38a861f738 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Wed, 4 Mar 2026 17:37:39 +0000 Subject: [PATCH] noop audit module --- apps/server/src/app.module.ts | 2 ++ apps/server/src/core/core.module.ts | 11 ----------- apps/server/src/integrations/audit/audit.module.ts | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 apps/server/src/integrations/audit/audit.module.ts diff --git a/apps/server/src/app.module.ts b/apps/server/src/app.module.ts index fc1d2c8b..6280ee09 100644 --- a/apps/server/src/app.module.ts +++ b/apps/server/src/app.module.ts @@ -25,6 +25,7 @@ import { CacheModule } from '@nestjs/cache-manager'; import KeyvRedis from '@keyv/redis'; import { LoggerModule } from './common/logger/logger.module'; import { ClsModule } from 'nestjs-cls'; +import { NoopAuditModule } from './integrations/audit/audit.module'; const enterpriseModules = []; try { @@ -47,6 +48,7 @@ try { middleware: { mount: true }, }), LoggerModule, + NoopAuditModule, CoreModule, DatabaseModule, EnvironmentModule, diff --git a/apps/server/src/core/core.module.ts b/apps/server/src/core/core.module.ts index f336cf8c..81dfc138 100644 --- a/apps/server/src/core/core.module.ts +++ b/apps/server/src/core/core.module.ts @@ -20,10 +20,6 @@ import { AuditContextMiddleware } from '../common/middlewares/audit-context.midd import { ShareModule } from './share/share.module'; import { NotificationModule } from './notification/notification.module'; import { WatcherModule } from './watcher/watcher.module'; -import { - AUDIT_SERVICE, - NoopAuditService, -} from '../integrations/audit/audit.service'; import { ClsMiddleware } from 'nestjs-cls'; @Module({ @@ -43,13 +39,6 @@ import { ClsMiddleware } from 'nestjs-cls'; NotificationModule, WatcherModule, ], - providers: [ - { - provide: AUDIT_SERVICE, - useClass: NoopAuditService, - }, - ], - exports: [AUDIT_SERVICE], }) export class CoreModule implements NestModule { configure(consumer: MiddlewareConsumer) { diff --git a/apps/server/src/integrations/audit/audit.module.ts b/apps/server/src/integrations/audit/audit.module.ts new file mode 100644 index 00000000..eafffdd7 --- /dev/null +++ b/apps/server/src/integrations/audit/audit.module.ts @@ -0,0 +1,14 @@ +import { Global, Module } from '@nestjs/common'; +import { AUDIT_SERVICE, NoopAuditService } from './audit.service'; + +@Global() +@Module({ + providers: [ + { + provide: AUDIT_SERVICE, + useClass: NoopAuditService, + }, + ], + exports: [AUDIT_SERVICE], +}) +export class NoopAuditModule {}