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