import 'package:dartz/dartz.dart';
import '../../../core/error/failures.dart';
import '../../entities/trade_order.dart';
import '../../repositories/trading_repository.dart';

class BuySharesParams {
  final String accountSequence;
  final String amount;

  BuySharesParams({required this.accountSequence, required this.amount});
}

class BuyShares {
  final TradingRepository repository;

  BuyShares(this.repository);

  Future<Either<Failure, TradeOrder>> call(BuySharesParams params) async {
    return await repository.buyShares(
      accountSequence: params.accountSequence,
      amount: params.amount,
    );
  }
}
