예제 #1
0
        public virtual void Add(T order)
        {
            if (!Orders.TryAdd(order))
            {
                throw new OrderingAddItemException(order.Id, Orders.FirstOrDefault()?.OrderRuleType.ToString());
            }

            var orderAdded = new OrderAdded
            {
                AddedAtDate          = DateTime.UtcNow,
                CountryType          = order.CountryType,
                FulFilled            = false,
                Id                   = order.Id,
                Items                = order.Items,
                LastTryDate          = DateTime.UtcNow,
                OrderOriginationDate = order.OrderDate
            };

            OrderAdded(orderAdded);
        }