Beispiel #1
0
        internal CheckedOutBasket(PendingBasketSnapshot snapshot, ShippingAddress shippingAddress) : this()
        {
            Version = snapshot.Version;

            if (shippingAddress == null)
            {
                throw new ArgumentException("can not check out, shipping address is empty");
            }
            if (snapshot.Lines == null || !snapshot.Lines.Any())
            {
                throw new EmptyBasketException(snapshot.Id, "can not check out, basket is empty");
            }

            Raise(new BasketCheckedOut(snapshot.Id, snapshot.Lines, shippingAddress));
        }
Beispiel #2
0
        internal CancelledBasket(PendingBasketSnapshot snapshot) : this()
        {
            Version = snapshot.Version;

            Raise(new BasketCancelled(snapshot.Id, snapshot.Lines));
        }