import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { TypeOrmModule } from '@nestjs/typeorm';
import { DatabaseModule } from '@it0/database';
import { AuditController } from './interfaces/rest/controllers/audit.controller';
import { AuditLogRepository } from './infrastructure/repositories/audit-log.repository';
import { AuditLog } from './domain/entities/audit-log.entity';
import { RecordAuditUseCase } from './application/use-cases/record-audit.use-case';
import { QueryAuditTrailUseCase } from './application/use-cases/query-audit-trail.use-case';

@Module({
  imports: [
    ConfigModule.forRoot({ isGlobal: true }),
    DatabaseModule.forRoot(),
    TypeOrmModule.forFeature([AuditLog]),
  ],
  controllers: [AuditController],
  providers: [AuditLogRepository, RecordAuditUseCase, QueryAuditTrailUseCase],
})
export class AuditModule {}
