import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { TypeOrmModule } from '@nestjs/typeorm';
import { CONNECTION_NAME } from 'src/core/strings/constants/base.constants';
import { TenantReadController } from './infrastructure/tenant-read.controller';
import { TenantReadOrchestrator } from './domain/usecases/tenant-read.orchestrator';
import { TenantDataController } from './infrastructure/tenant-data.controller';
import { TenantDataOrchestrator } from './domain/usecases/tenant-data.orchestrator';
import { CreateTenantManager } from './domain/usecases/managers/create-tenant.manager';
import { CqrsModule } from '@nestjs/cqrs';
import { IndexTenantManager } from './domain/usecases/managers/index-tenant.manager';
import { DeleteTenantManager } from './domain/usecases/managers/delete-tenant.manager';
import { UpdateTenantManager } from './domain/usecases/managers/update-tenant.manager';
import { ActiveTenantManager } from './domain/usecases/managers/active-tenant.manager';
import { ConfirmTenantManager } from './domain/usecases/managers/confirm-tenant.manager';
import { InactiveTenantManager } from './domain/usecases/managers/inactive-tenant.manager';
import { DetailTenantManager } from './domain/usecases/managers/detail-tenant.manager';
import { BatchDeleteTenantManager } from './domain/usecases/managers/batch-delete-tenant.manager';
import { BatchActiveTenantManager } from './domain/usecases/managers/batch-active-tenant.manager';
import { BatchConfirmTenantManager } from './domain/usecases/managers/batch-confirm-tenant.manager';
import { BatchInactiveTenantManager } from './domain/usecases/managers/batch-inactive-tenant.manager';
import { UserModel } from '../user/data/models/user.model';
import { UpdatePasswordTenantManager } from './domain/usecases/managers/update-password-tenant.manager';
import { UserDataService } from '../user/data/services/user-data.service';
import { UserReadService } from '../user/data/services/user-read.service';
import { TenantItemReadController } from './infrastructure/tenant-item-read.controller';
import { TenantItemDataController } from './infrastructure/tenant-item-data.controller';
import { UserLoginModel } from '../user/data/models/user-login.model';

@Module({
  imports: [
    ConfigModule.forRoot(),
    TypeOrmModule.forFeature(
      [UserModel, UserLoginModel],
      CONNECTION_NAME.DEFAULT,
    ),
    CqrsModule,
  ],
  controllers: [
    TenantDataController,
    TenantReadController,
    TenantItemReadController,
    TenantItemDataController,
  ],
  providers: [
    IndexTenantManager,
    DetailTenantManager,
    CreateTenantManager,
    DeleteTenantManager,
    UpdateTenantManager,
    UpdatePasswordTenantManager,
    ActiveTenantManager,
    ConfirmTenantManager,
    InactiveTenantManager,
    BatchDeleteTenantManager,
    BatchActiveTenantManager,
    BatchConfirmTenantManager,
    BatchInactiveTenantManager,

    UserDataService,
    UserReadService,

    TenantDataOrchestrator,
    TenantReadOrchestrator,
  ],
})
export class TenantModule {}
