import { Module } from '@nestjs/common';
import { UserApplicationService } from './services/user-application.service';
import { TokenService } from './services/token.service';
import { TotpService } from './services/totp.service';
import { AutoCreateAccountHandler } from './commands/auto-create-account/auto-create-account.handler';
import { RecoverByMnemonicHandler } from './commands/recover-by-mnemonic/recover-by-mnemonic.handler';
import { RecoverByPhoneHandler } from './commands/recover-by-phone/recover-by-phone.handler';
import { BindPhoneHandler } from './commands/bind-phone/bind-phone.handler';
import { GetMyProfileHandler } from './queries/get-my-profile/get-my-profile.handler';
import { GetMyDevicesHandler } from './queries/get-my-devices/get-my-devices.handler';
import { MpcKeygenCompletedHandler } from './event-handlers/mpc-keygen-completed.handler';
import { BlockchainWalletHandler } from './event-handlers/blockchain-wallet.handler';
import { DomainModule } from '@/domain/domain.module';
import { InfrastructureModule } from '@/infrastructure/infrastructure.module';

@Module({
  imports: [DomainModule, InfrastructureModule],
  providers: [
    UserApplicationService,
    TokenService,
    TotpService,
    AutoCreateAccountHandler,
    RecoverByMnemonicHandler,
    RecoverByPhoneHandler,
    BindPhoneHandler,
    GetMyProfileHandler,
    GetMyDevicesHandler,
    // MPC Event Handlers
    MpcKeygenCompletedHandler,
    // Blockchain Event Handlers
    BlockchainWalletHandler,
  ],
  exports: [
    UserApplicationService,
    TokenService,
    TotpService,
    AutoCreateAccountHandler,
    RecoverByMnemonicHandler,
    RecoverByPhoneHandler,
    BindPhoneHandler,
    GetMyProfileHandler,
    GetMyDevicesHandler,
  ],
})
export class ApplicationModule {}
