public void DecreaseStock(Drug drug, int decrease) { if (stockProvider.StockCount(drug) <= 0) throw new StockIsEmptyException(); if (stockProvider.StockCount(drug) < decrease) throw new StockIsTooLowException(); stockProvider.DecreaseStock(drug, decrease); }
public Prescription(DateTime expiry, IClock clock, Drug drug) { this.expiry = expiry; this.clock = clock; }
public int StockCount(Drug drug) { return stockProvider.StockCount(drug); }
public bool IsDrugInStock(Drug drug) { return stockProvider.StockCount(drug) > 0; }