Добавлен метод ReadElement для логики заказа

This commit is contained in:
Никита Потапов 2024-04-22 12:01:43 +04:00
parent 4b1cc73321
commit f6e470911d
2 changed files with 18 additions and 0 deletions

View File

@ -123,5 +123,22 @@ namespace SecuritySystemBusinessLogic.BusinessLogics
}
_logger.LogInformation("Order. Sum:{Cost}. Id: {Id}", model.Sum, model.Id);
}
public OrderViewModel? ReadElement(OrderSearchModel? model)
{
if (model == null)
{
throw new ArgumentNullException(nameof(model));
}
_logger.LogInformation("ReadElement. Order Id:{Id}", model.Id);
var element = _orderStorage.GetElement(model);
if (element == null)
{
_logger.LogWarning("ReadElement element not found");
return null;
}
_logger.LogInformation("ReadElement find. Id:{Id}", element.Id);
return element;
}
}
}

View File

@ -7,6 +7,7 @@ namespace SecuritySystemContracts.BusinessLogicsContracts
public interface IOrderLogic
{
List<OrderViewModel>? ReadList(OrderSearchModel? model);
OrderViewModel? ReadElement(OrderSearchModel? model);
bool CreateOrder(OrderBindingModel model);
bool TakeOrderInWork(OrderBindingModel model);
bool FinishOrder(OrderBindingModel model);