public void Decrease(StockQuantity amount) { if (Quantity - amount < 0) { throw new InsufficientStockException(); } Quantity -= amount; }
protected bool Equals(StockQuantity other) { return(value == other.value); }
public Stock(ProductId productId, StockQuantity quantity) { ProductId = productId; Quantity = quantity; }