class PortfolioItemEventHandler {

    @EventHandler
    public void on(ItemsAddedToPortfolioEvent event) {
        OrderBookId orderBookId = event.getOrderBookId();
        logger.debug("Handle ItemsAddedToPortfolioEvent for orderBook with identifier {}", orderBookId);

        ItemEntry itemEntry = createItemEntry(orderBookId.getIdentifier(), event.getAmountOfItemsAdded());

        PortfolioView portfolioView = portfolioViewRepository.findOne(event.getPortfolioId().getIdentifier());
        portfolioView.addItemInPossession(itemEntry);

        portfolioViewRepository.save(portfolioView);
    }

    @Autowired public  PortfolioItemEventHandler(PortfolioViewRepository portfolioViewRepository,
                                     OrderBookViewRepository orderBookViewRepository);

}