public AcceptOrderDecision Evaluate(SalesOrder salesOrder) { var s = _sessionFactory.CreateSession(); foreach (var shippingOption in ShippingOptions.ShippingOptions.All) { s.Insert(shippingOption); } foreach (var i in _inventoryLevels.GetInventory(salesOrder.LineItems.Select(li=>li.Sku).ToArray())) { s.Insert(i); } s.Insert(salesOrder); foreach (var li in salesOrder.LineItems) { s.Insert(li); } s.Fire(); s.AttachLogs(); s.Fire(); return new AcceptOrderDecision(); }
public AssignInventoryDecision Evaluate(SalesOrder payload) { var s = _factory.CreateSession(); s.Insert(payload); s.Fire(); //build out return object return new AssignInventoryDecision(); }
public void Process(SalesOrder order) { var acceptOrder = _accept.Decide(order); if (acceptOrder.Rejected) { //return acceptOrder; } //var a = Chainer.Chain(bob.Go(input)) // .Chain(bill.Go(input2)) // .Chain(mary.Go(input3)) //verify SLA / Shopping //find inventory locations //place order }