import { Module } from '@nestjs/common' import { MongooseModule } from '@nestjs/mongoose' import { AuditModule } from '../audit/audit.module.js' import { IntegrationsModule } from '../integrations/integrations.module.js' import { IngestCursor, IngestCursorSchema, } from '../schemas/ingest-cursor.schema.js' import { Tenant, TenantSchema } from '../schemas/tenant.schema.js' import { AuthentikIngest } from './authentik.ingest.js' // Workers that pull audit events from external systems (Authentik today, // Stalwart + OCIS later) and forward them to AuditService. Each worker owns // its own cursor in the ingest_cursors collection so restarts resume cleanly. @Module({ imports: [ AuditModule, IntegrationsModule, MongooseModule.forFeature([ { name: IngestCursor.name, schema: IngestCursorSchema }, { name: Tenant.name, schema: TenantSchema }, ]), ], providers: [AuthentikIngest], }) export class IngestModule {}