@Override protected boolean doMatches(CreateSellOrderCommand command) { return command.getOrderBookId().equals(orderbookIdentifier) && command.getPortfolioId().equals(portfolioIdentifier) && tradeCount == command.getTradeCount() && itemPrice == command.getItemPrice(); }
@CommandHandler public void handleSellOrder(CreateSellOrderCommand command) { OrderBook orderBook = repository.load(command.getOrderBookId(), null); orderBook.addSellOrder( command.getOrderId(), command.getTransactionId(), command.getTradeCount(), command.getItemPrice(), command.getPortfolioId()); }