repository = $repository; } /** * @param string $orderId * @param StepObject $step * @return JsonResponse * @throws InternalServerErrorException */ public function execute(string $orderId, StepObject $step){ try{ $repository = $this->repository->where('order_id',$orderId)->where('reference_id',$step->getReferenceId())->first(); $repository->complete_date = $step->getCompleteDate(); $repository->save(); return new JsonResponse([], HttpStatus::OK); } catch (\Exception $exception){ throw new InternalServerErrorException("Failed to update step complete date because {$exception->getMessage()}"); } } }