updatesOrderWarehouse = $updatesOrderWarehouse; } /** * @param String $orderId * @param Request $request * @return JsonResponse * @throws InternalServerErrorException */ public function execute(String $orderId, Request $request){ try { $this->updatesOrderWarehouse->execute($orderId, $request->input('warehouse_id'), 0); $this->updatesOrderWarehouse->execute($orderId, $request->input('warehouse_id'), 1); return new JsonResponse(null, HttpStatus::REQUEST_ACCEPTED); } catch (\Exception $exception){ throw new InternalServerErrorException("Failed to set warehouse because {$exception->getMessage()}"); } } }