-
-
Save dcomartin/c74588bc338fc051b46eeddf49a10481 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ShipProduct(int quantity) | |
{ | |
if (quantity <= 0) | |
{ | |
throw new InvalidDomainException("Quantity must be greater than zero."); | |
} | |
if (quantity > _warehouseProductState.QuantityOnHand) | |
{ | |
throw new InvalidDomainException("Cannot Ship to a negative Quantity on Hand."); | |
} | |
var productShipped = new ProductShipped(Sku, quantity, DateTime.UtcNow); | |
Apply(productShipped); | |
Add(productShipped); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment