import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { TenantORM } from '../infrastructure/database/postgres/entities/tenant.orm';
import { AdminORM } from '../infrastructure/database/postgres/entities/admin.orm';
import { TenantManagementService } from './application/services/tenant-management.service';
import { TenantController } from './adapters/inbound/tenant.controller';

/**
 * 超级管理员模块
 *
 * 提供租户管理功能，仅超级管理员可访问:
 * - 租户 CRUD
 * - 租户暂停/激活/归档
 * - 租户管理员管理
 * - 跨租户统计
 */
@Module({
  imports: [
    TypeOrmModule.forFeature([TenantORM, AdminORM]),
  ],
  controllers: [TenantController],
  providers: [TenantManagementService],
  exports: [TenantManagementService],
})
export class SuperAdminModule {}
