import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AdminController } from '../adapters/inbound/admin.controller';
import { AdminService } from '../application/services/admin.service';
import { AdminPostgresRepository } from '../adapters/outbound/persistence/admin-postgres.repository';
import { AdminORM } from '../infrastructure/database/postgres/entities/admin.orm';
import { ADMIN_REPOSITORY } from '../domain/repositories/admin.repository.interface';

@Module({
  imports: [
    TypeOrmModule.forFeature([AdminORM]),
  ],
  controllers: [AdminController],
  providers: [
    AdminService,
    {
      provide: ADMIN_REPOSITORY,
      useClass: AdminPostgresRepository,
    },
  ],
  exports: [AdminService],
})
export class AdminModule {}
