// Maximum number of units that can be in-stock at any time (due to physicial/logistical constraints in warehouses)
publicintMaxStockThreshold{get;set;}
/// <summary>
/// True if item is on reorder
/// </summary>
publicboolOnReorder{get;set;}
publicCatalogItem(){}
/// <summary>
/// Decrements the quantity of a particular item in inventory and ensures the restockThreshold hasn't
/// been breached. If so, a RestockRequest is generated in CheckThreshold.
///
/// If there is sufficient stock of an item, then the integer returned at the end of this call should be the same as quantityDesired.
/// In the event that there is not sufficient stock available, the method will remove whatever stock is available and return that quantity to the client.
/// In this case, it is the responsibility of the client to determine if the amount that is returned is the same as quantityDesired.
/// It is invalid to pass in a negative number.
/// </summary>
/// <param name="quantityDesired"></param>
/// <returns>int: Returns the number actually removed from stock. </returns>
///
publicintRemoveStock(intquantityDesired)
{
if(AvailableStock==0)
{
thrownewCatalogDomainException($"Empty stock, product item {Name} is sold out");
}
if(quantityDesired<=0)
{
thrownewCatalogDomainException($"Item units desired should be greater than cero");