repository = $repository; } public function execute(CustomerRelationObject $customerRelationObject){ try{ $this->repository->updateOrCreate( [ 'forwarder_id' => $customerRelationObject->getForwarderId(), 'company_id' => $customerRelationObject->getCompanyId(), ], [ 'customer_rate' => $customerRelationObject->getCustomerRate(), 'wave' => $customerRelationObject->isWave(), ]); return new JsonResponse([],HttpStatus::OK); }catch(\Exception $exception){ throw new InternalServerErrorException("Failed to update Customer Relation because {$exception->getMessage()}"); } } }