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

class SellSharesParams {
  final String accountSequence;
  final String amount;

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

class SellShares {
  final TradingRepository repository;

  SellShares(this.repository);

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