import 'package:dartz/dartz.dart';
import 'package:injectable/injectable.dart';
import 'package:superport/core/errors/failures.dart';
import 'package:superport/domain/usecases/base_usecase.dart';
import 'package:superport/domain/repositories/lookups_repository.dart';

/// Lookups 초기화 UseCase
@injectable
class InitializeLookupsUseCase implements UseCase<bool, NoParams> {
  final LookupsRepository _repository;

  InitializeLookupsUseCase(this._repository);

  @override
  Future<Either<Failure, bool>> call(NoParams params) async {
    // Repository의 getAllLookups를 호출하여 캐시 초기화
    final result = await _repository.getAllLookups();

    return result.fold((failure) => Left(failure), (_) => const Right(true));
  }
}
