import { Module } from '@nestjs/common';
import { MigrationService } from './migration.service';
import { MigrationController } from './migration.controller';

/**
 * MigrationModule - Module for database migration management
 *
 * This module organizes all components related to database migration operations.
 * It provides HTTP endpoints for controlled execution of database migrations
 * with proper authentication and security measures.
 *
 * Key features:
 * - HTTP interface for migration execution
 * - Security protection via MigrationGuard (applied at controller level)
 * - Separation of concerns between migration logic and application logic
 *
 * Security considerations:
 * - Migration endpoints should be disabled or heavily restricted in production
 * - Consider implementing additional safeguards (IP whitelisting, 2FA)
 * - Log all migration attempts for audit purposes
 *
 * @example
 * // Import into main AppModule (typically only in development/staging)
 * @Module({
 *   imports: [MigrationModule, ...],
 * })
 * export class AppModule {}
 *
 * @note Consider conditionally importing this module based on environment
 */
@Module({
  // HTTP controller for migration endpoints
  controllers: [MigrationController],

  // Service provider for migration business logic
  providers: [MigrationService],

  // Note: MigrationGuard is not listed here because it's applied at the
  // controller level using @UseGuards() decorator
})
export class MigrationModule {}
