import 'package:dartz/dartz.dart';

import '../../../../core/errors/failures.dart';
import '../entities/user_entity.dart';
import '../repositories/users_repository.dart';

/// Use case for syncing users from API
/// Forces refresh from API and saves to local storage
class SyncUsersUseCase {
  final UsersRepository repository;

  SyncUsersUseCase(this.repository);

  Future<Either<Failure, List<UserEntity>>> call() async {
    return await repository.syncUsers();
  }
}
