import 'package:dartz/dartz.dart';
import 'package:food_delivery_client/core/usecase/usecase.dart';
import 'package:food_delivery_client/feature/auth/data/models/response/login_response.dart';
import 'package:food_delivery_client/feature/auth/domain/repository/auth_repository.dart';
import 'package:food_delivery_client/food_delivery_client.dart';
@injectable
class LoginUseCase implements UseCase<LoginResponseModel, LoginParams> {
  final AuthRepository _authRepository;

  LoginUseCase(this._authRepository);

  @override
  Future<Either<Failure, LoginResponseModel>> call(LoginParams params) async {
    return _authRepository.login(
      phoneNumber: params.phoneNumber,
      password: params.password,
    );
  }
}

class LoginParams {
  final String phoneNumber;
  final String password;

  LoginParams({required this.phoneNumber, required this.password});
}
