/**
 * Audit Module
 *
 * Provides audit logging functionality
 */

import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AuditController } from '../controllers/audit.controller';
import { AuditService } from '../services/audit.service';
import { AuditLogOrmEntity } from '../../infrastructure/persistence/typeorm/entities/audit-log.orm-entity';
import { TypeOrmAuditLogRepository } from '../../infrastructure/persistence/typeorm/repositories/typeorm-audit-log.repository';
import { AUDIT_LOG_REPOSITORY } from '@domain/ports/out/audit-log.repository';

@Module({
  imports: [TypeOrmModule.forFeature([AuditLogOrmEntity])],
  controllers: [AuditController],
  providers: [
    AuditService,
    {
      provide: AUDIT_LOG_REPOSITORY,
      useClass: TypeOrmAuditLogRepository,
    },
  ],
  exports: [AuditService],
})
export class AuditModule {}
