import { Module } from '@nestjs/common'
import { MongooseModule } from '@nestjs/mongoose'
import { AuthModule } from '../auth/auth.module.js'
import { ColdModule } from '../cold/cold.module.js'
import {
  AuditCheckpoint,
  AuditCheckpointSchema,
} from '../schemas/audit-checkpoint.schema.js'
import {
  AuditCounter,
  AuditCounterSchema,
} from '../schemas/audit-counter.schema.js'
import { AuditEvent, AuditEventSchema } from '../schemas/audit-event.schema.js'
import { AuditController } from './audit.controller.js'
import { AuditService } from './audit.service.js'
import { CheckpointService } from './checkpoint.service.js'
import { AuditVerifier } from './verifier.service.js'

@Module({
  imports: [
    AuthModule,
    ColdModule,
    MongooseModule.forFeature([
      { name: AuditEvent.name, schema: AuditEventSchema },
      { name: AuditCounter.name, schema: AuditCounterSchema },
      { name: AuditCheckpoint.name, schema: AuditCheckpointSchema },
    ]),
  ],
  controllers: [AuditController],
  providers: [AuditService, CheckpointService, AuditVerifier],
  exports: [AuditService],
})
export class AuditModule {}
