setsOrderWarehouse = $setsOrderWarehouse; $this->updatesStepCompleteDate = $updatesStepCompleteDate; } /** * @param string $orderId * @param Request $request * @return JsonResponse * @throws InternalServerErrorException */ public function execute(string $orderId, Request $request){ try{ $orderObject = new OrderObject($orderId, null, $request->input('warehouse_id')); $this->setsOrderWarehouse->execute($orderObject); $stepObject = new StepObject(Constants::ORDER_WAREHOUSE_RECEIVING_STEP, $request->input('complete_date')); $this->updatesStepCompleteDate->execute($orderObject, $stepObject); return new JsonResponse([], HttpStatus::RESOURCE_CREATED); }catch(\Exception $exception) { throw new InternalServerErrorException("Failed to update order's packing list because {$exception->getMessage()}"); } } }