import 'package:cargocalculaterapp/core/error/failure.dart';
import 'package:cargocalculaterapp/core/usecase/usecase.dart';
import 'package:cargocalculaterapp/features/calculator/data/model/lead_create_request.dart';
import 'package:cargocalculaterapp/features/calculator/data/model/lead_create_response.dart';
import 'package:dartz/dartz.dart';

import '../repository/calculator_repository.dart';

class CreateLeadUseCase
    extends UseCase<LeadCreateResponse, LeadCreateRequest> {
  final CalculatorRepository repository;

  CreateLeadUseCase(this.repository);

  @override
  Future<Either<Failure, LeadCreateResponse>> call(
    LeadCreateRequest params,
  ) async {
    return await repository.createLead(params);
  }
}
