MIF_E31221222/sigap-website/di/modules/authentication.module.ts

41 lines
1.5 KiB
TypeScript

import { createModule } from '@evyweb/ioctopus';
import { DI_SYMBOLS } from '@/di/types';
import { signInController, signOutController, verifyOtpController } from '@/src/interface-adapters/controllers/auth/authentication-controller';
import { AuthenticationService } from '@/src/infrastructure/services/authentication.service';
import { IInstrumentationServiceImpl } from '@/src/application/services/instrumentation.service.interface';
export function createAuthenticationModule() {
const authenticationModule = createModule();
authenticationModule
.bind(DI_SYMBOLS.IAuthenticationService)
.toClass(AuthenticationService, [
DI_SYMBOLS.IUsersRepository,
DI_SYMBOLS.IInstrumentationService,
]);
// Rest of your bindings remain the same
authenticationModule
.bind(DI_SYMBOLS.ISignInController)
.toHigherOrderFunction(signInController, [
DI_SYMBOLS.IInstrumentationService,
DI_SYMBOLS.ISignInUseCase,
]);
authenticationModule
.bind(DI_SYMBOLS.IVerifyOtpController)
.toHigherOrderFunction(verifyOtpController, [
DI_SYMBOLS.IInstrumentationService,
DI_SYMBOLS.IVerifyOtpUseCase,
]);
authenticationModule
.bind(DI_SYMBOLS.ISignOutController)
.toHigherOrderFunction(signOutController, [
DI_SYMBOLS.IInstrumentationService,
DI_SYMBOLS.ISignOutUseCase,
]);
return authenticationModule;
}