@Override public void RemoveFromCart(String productReference) { EventStoreRepo eventStoreRepo = new EventStoreRepo(); this.domainService.RemoveFromCart(productReference); Data data = new OrderDataFactory().getData("RemoveFromCart", productReference, 1); eventStoreRepo.sendEvent(data); }
@Override public boolean AddToCart(String productReference) throws RemoteException { EventStoreRepo eventStoreRepo = new EventStoreRepo(); boolean result = this.domainService.AddToCart(productReference); Data data = new OrderDataFactory().getData("AddToCart", productReference, 1); eventStoreRepo.sendEvent(data); return result; }
@Override public SupplierStub.Product GetProduct(String productReference) throws AxisFault, RemoteException { EventStoreRepo eventStoreRepo = new EventStoreRepo(); SupplierStub.Product result = this.domainService.GetProduct(productReference); Data data = new OrderDataFactory().getData("GetProduct", productReference, 0); eventStoreRepo.sendEvent(data); return result; }
@Override public boolean ProcessOrder() throws AxisFault, RemoteException { EventStoreRepo eventStoreRepo = new EventStoreRepo(); boolean result = this.domainService.ProcessOrder(); for (CartItem item : this.domainService.GetCart("EUR")) { Data data = new OrderDataFactory() .getData("ProcessOrder", item.getProduct().getReference(), item.getQuantity()); eventStoreRepo.sendEvent(data); } return result; }