fix ShopLogic

This commit is contained in:
DavidMakarov 2024-05-17 01:43:54 +04:00
parent cc2bb7f7f5
commit 69fb9400f4

View File

@ -100,6 +100,12 @@ namespace FlowerShopBusinessLogic.BusinessLogics
_logger.LogWarning("MakeSupply(GetElement). Element not found");
return false;
}
int CurrentRepairsNum = shop.ShopFlowers.Select(x => x.Value.Item2).Sum();
if (count > (shop.MaximumFlowers - CurrentRepairsNum))
{
_logger.LogWarning("Попытка добавить в магазин число элементов, большее RepairsMaxCount");
return false;
}
if (shop.ShopFlowers.ContainsKey(flower.Id))
{
var shopFlower = shop.ShopFlowers[flower.Id];