import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { TypeOrmModule } from '@nestjs/typeorm';
import { DatabaseModule } from '@it0/database';
import { ServerController } from './interfaces/rest/controllers/server.controller';
import { ClusterController } from './interfaces/rest/controllers/cluster.controller';
import { CredentialVaultService } from './infrastructure/crypto/credential-vault.service';
import { ServerRepository } from './infrastructure/repositories/server.repository';
import { ClusterRepository } from './infrastructure/repositories/cluster.repository';
import { CredentialController } from './interfaces/rest/controllers/credential.controller';
import { CredentialRepository } from './infrastructure/repositories/credential.repository';
import { PoolServerController } from './interfaces/rest/controllers/pool-server.controller';
import { PoolServerRepository } from './infrastructure/repositories/pool-server.repository';
import { Server } from './domain/entities/server.entity';
import { Cluster } from './domain/entities/cluster.entity';
import { Credential } from './domain/entities/credential.entity';
import { SshConfig } from './domain/entities/ssh-config.entity';
import { PoolServer } from './domain/entities/pool-server.entity';

@Module({
  imports: [
    ConfigModule.forRoot({ isGlobal: true }),
    DatabaseModule.forRoot(),
    TypeOrmModule.forFeature([Server, Cluster, Credential, SshConfig, PoolServer]),
  ],
  controllers: [ServerController, ClusterController, CredentialController, PoolServerController],
  providers: [CredentialVaultService, ServerRepository, ClusterRepository, CredentialRepository, PoolServerRepository],
})
export class InventoryModule {}
