public function run(): void 	{ 		$professions = Profession::professions()->get();  		if ($professions->isEmpty()) { 			ProfessionFactory::new()->withParentCategory()->count(10)->create(); 			$professions = Profession::professions()->get(); 		}  		foreach (ClientSurvey::ppiSurveys()->get() as $client_survey) { 			$client_survey->applicants()->delete();  			ApplicantFactory::new() 			->forClientSurvey($client_survey) 			->active() 			->withoutMail() 			->draft() 			->notFilled() 			->online() 			->count(50) 			->create();  			$mainQuestions = $client_survey->survey->questions;  			$demographicQuestions = $client_survey->demographicQuestions;  			$domain = $client_survey->domain;  			$companies = Company::byDomain($domain)->available();  			if ($companies->count() < 50) { 				CompanyFactory::new() 				->count(50) 				->approved() 				->forDomain($domain) 				->create(); 			}  			$companies = $companies->get();  			foreach ($client_survey->applicants as $applicant) { 				$applicant->answers()->delete();  				/** @var Question $question 				 */ 				foreach ($mainQuestions as $question) { 					AnswerFactory::new() 					->forQuestion($question) 					->forClientSurvey($client_survey) 					->forApplicant($applicant) 					->create(); 				}  				foreach ($demographicQuestions as $question) { 					AnswerFactory::new() 					->forQuestion($question) 					->forClientSurvey($client_survey) 					->forApplicant($applicant) 					->create(); 				}  				$applicant->update([ 					'draft' => false, 					'filled' => true, 					'profession_id' => $professions->random()->getKey(), 				]);  				$company_choices = [];  				for ($i = 1; $i < 4; $i++) { 					do { 						$company_choice = $companies->random()->name; 					} while (in_array($company_choice, $company_choices)); 					$company_choices[$i] = $company_choice; 				}  				foreach ($company_choices as $rank => $company_name) { 					$company_match = $domain->companies()->includes()->search($company_name); 					$company = $company_match->first();  					if ($company_match->count() == 0) { 						$company = Company::create([ 							'name' => $company_name, 							'domain_id' => $domain->getKey(), 						]); 					}  					if ($company) { 						$applicant->applicantCompanyPivot()->updateOrCreate([ 							'applicant_id' => $applicant->getKey(), 							'company_id' => $company->getKey(), 							'rank' => $rank, 						]); 					} 				} 			} 		} 	}