public void CompleteOrderDelivery([FromBody] CompletedOrderRequestDto completedOrderRequestModel) { _logger.LogInformation($"Завершение заказа: { completedOrderRequestModel.OrderId } пользователем {HttpContext.User.Identity?.Name ?? "Unknown"}"); var recievedTime = DateTime.Now; var user = _userManager.GetUserAsync(User).Result; var driver = _employeeData.GetByAPILogin(user.UserName); var resultMessage = "OK"; try { _actionTimeHelper.ThrowIfNotValid(recievedTime, completedOrderRequestModel.ActionTime); _aPIOrderData.CompleteOrderDelivery( driver, completedOrderRequestModel.OrderId, completedOrderRequestModel.BottlesReturnCount, completedOrderRequestModel.Rating, completedOrderRequestModel.DriverComplaintReasonId, completedOrderRequestModel.OtherDriverComplaintReasonComment, recievedTime ); } catch (Exception ex) { resultMessage = ex.Message; throw; } finally { _driverMobileAppActionRecordModel.RegisterAction(driver, DriverMobileAppActionType.CompleteOrderClicked, completedOrderRequestModel.ActionTime, recievedTime, resultMessage); } }