createCompanyProcessor = $createCompanyProcessor; $this->updatesCompanyStatus = $updatesCompanyStatus; $this->createCompanyModuleProcessor = $createCompanyModuleProcessor; $this->createContactProcessor = $createContactProcessor; $this->createsCompanyConnection = $createsCompanyConnection; $this->approvesCompanyConnection = $approvesCompanyConnection; $this->createAddressFromOldAddressProcessor = $createAddressFromOldAddressProcessor; $this->createsAddress = $createsAddress; $this->createsCompany = $createsCompany; $this->createsContact = $createsContact; $this->createsUser = $createsUser; $this->assignEmployeeProcessor = $assignEmployeeProcessor; } /** * Run the database seeds. * * @return void * @throws \App\Classes\Exceptions\AccessForbiddenException * @throws \App\Classes\Exceptions\MalformedRequestException * @throws \App\Classes\Exceptions\RequestValidationException */ public function run() { $companies = [ new CompanyObject('Last Mile Delivery', 'HWT', CompanyType::COMPANY_BUSINESS, ApprovalStatus::APPROVED), ]; foreach ($companies as $companyObject) { /** @var Company $company */ $company = $this->createsCompany->execute($companyObject); /** @var CompanyModule $companyModule */ $companyModule = $this->createCompanyModuleProcessor->execute($company, BusinessType::LAST_MILE_DELIVERY_AGENT); $address = new AddressObject('B-39-13, Menara Simfoni, Jalan Simfoni 2, Balakong', 'Block 3730,Persiaran APEC', 1, 15, 432, 43300, AddressType::BILLING, ApprovalStatus::APPROVED); $this->createsAddress->execute($companyModule, $address); $contact = new ContactObject('Office Number', '01155543194', '', ''); $this->createsContact->execute($companyModule, $contact); $user_object = new RegistrationObject('CQ', 'hywavetech168@gmail.com', 'FIzxqcZFFob7btVLEfWC', 'FIzxqcZFFob7btVLEfWC', RoleTypes::USER, ApprovalStatus::APPROVED); /** @var User $user */ $user = $this->createsUser->execute($user_object); $Object = new EmploymentObject($companyModule, $user); $this->assignEmployeeProcessor->execute($Object); continue; } } }