setsOrderWarehouse = $setsOrderWarehouse; } /** * @param String $orderId * @param Request $request * @return JsonResponse * @throws InternalServerErrorException */ public function execute(String $orderId, Request $request){ try { $order = new OrderObject($orderId); $order->setWarehouseId($request->input('warehouse_id')); $this->setsOrderWarehouse->execute($order); return new JsonResponse(null, HttpStatus::REQUEST_ACCEPTED); } catch (\Exception $exception){ throw new InternalServerErrorException("Failed to update order's packing list because {$exception->getMessage()}"); } } }