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', 'LMD', 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('Malaysian Global Innovation & Creativity Center Level 1 CWS', 'Block 3730,Persiaran APEC', 1, 15, 402, 63000, AddressType::BILLING, ApprovalStatus::APPROVED); $this->createsAddress->execute($companyModule, $address); $contact = new ContactObject('Office Number', '0182909252', '', ''); $this->createsContact->execute($companyModule, $contact); $user_object = new RegistrationObject('Winson', 'admin@last-mile-delivery.com', '1234567abcabc', '1234567abcabc', RoleTypes::USER, ApprovalStatus::APPROVED); /** @var User $user */ $user = $this->createsUser->execute($user_object); $Object = new EmploymentObject($companyModule, $user); $this->assignEmployeeProcessor->execute($Object); continue; } } }