import { ContainerModule } from 'inversify';
import { AuthService } from '../../services/auth/AuthService';
import { SessionService } from '../../services/auth/SessionService';

import {
  AUTH_SERVICE_TOKEN,
  SESSION_SERVICE_TOKEN,
} from '../tokens';

export const AuthModule = new ContainerModule((options) => {
  const bind = options.bind;

  // Session Service
  bind<SessionService>(SESSION_SERVICE_TOKEN)
    .to(SessionService)
    .inSingletonScope();

  // Auth Service - now creates its own dependencies
  bind<AuthService>(AUTH_SERVICE_TOKEN)
    .to(AuthService)
    .inSingletonScope();
});
