import 'package:get_it/get_it.dart';
import 'repositories/auth_repository.dart';
import 'repositories/file_repository.dart';
import 'repositories/mock_auth_repository.dart';
import 'repositories/mock_file_repository.dart';
import 'services/auth_service.dart';
import 'services/file_service.dart';
import 'viewmodels/login_view_model.dart';
import 'viewmodels/file_explorer_view_model.dart';

final getIt = GetIt.instance;

void configureDependencies() {
  // Register repositories
  getIt.registerSingleton<AuthRepository>(MockAuthRepository());
  getIt.registerSingleton<FileRepository>(MockFileRepository());

  // Register services
  getIt.registerSingleton<AuthService>(AuthService(getIt<AuthRepository>()));
  getIt.registerSingleton<FileService>(FileService(getIt<FileRepository>()));

  // Register viewmodels
  getIt.registerSingleton<LoginViewModel>(LoginViewModel(getIt<AuthService>()));
  getIt.registerSingleton<FileExplorerViewModel>(
    FileExplorerViewModel(getIt<FileService>()),
  );
}
