public function update(Domain $domain, ClientSurvey $id, StoreClientSurveyPulsAPI $request, ClientSurveyService $client_survey_service): JsonResource 	{ 		$client = $request->user()->user;  		if ($client_survey_service->canEditSurvey($id, $client)) { 			abort(403, (string) __('client-surveys.you-cannot-edit-this-survey')); 		}  		$client_survey_service->checkPulsQuestions($request);  		$survey = $client_survey_service->updatePulsClientSurvey($id, $request, $client);  		$client_survey_service->handleExtraAndDemographicQuestions($request, $survey);  		$client_survey_service->handlePulsQuestionsApi($request, $survey);  		$survey->generateApplicants($request->emails, $request->offline_applicants_count, $request->email_languages);  		$client_survey_service->handleQuestionScrambling($survey);  		$client_survey_service->handleLocationsAndDepartmentDeletion($request, $survey); 		$client_survey_service->handleLocationsAndDepartmentCreation($request, $survey); 		$client_survey_service->handleLocationsAndDepartmentUpdate($request, $survey);  		if (!$survey->draft) { 			$client_survey_service->changeSurveyToPending($survey); 		}  		// Schedule webhooks | Won't schedule if testing 		$client_survey_notification_service = new ClientSurveyNotificationService; 		$client_survey_notification_service->handleWebhooks($id);  		$id->load(['locations', 'departments', 'pulsQuestions', 'extraQuestions', 'demographicQuestions', 'applicants' => function ($query) { 			$query->fillingOnlineSurvey()->mailable(); 		}]);  		return new ClientSurveyPulsResourceSingle($id); 	}