createsCompanyModule = $createsCompanyModule; $this->createUnityEntityProcessor = $createUnityEntityProcessor; $this->canCreateCompanyModule = $canCreateCompanyModule; } /** * @param Company $company * @return Model */ public function execute(Company $company , ?int $businessType): Model { $unityEntity = $this->createUnityEntityProcessor->execute($company->name); $company_module_object = new CompanyModuleObject( $company->id, $businessType??BusinessType::IMPORTER, $company->status, $unityEntity->hash_id ); $this->canCreateCompanyModule->passes($company_module_object); return $this->createsCompanyModule->execute($company_module_object); } }