createsDocument = $createsDocument; $this->createsFile = $createsFile; $this->createPurchaseOrderFor1688OrderProcessor = $createPurchaseOrderFor1688OrderProcessor; } /** * @param Booking $booking * @param array $files * @return void * @throws \App\Classes\Exceptions\MalformedRequestException */ public function execute(Booking $booking, array $files) { $object = new DocumentObject(DocumentType::ECOMMERCE_PURCHASE_ORDER, $files, '', ApprovalStatus::APPROVED, '1688_purchase_orders'); /** @var Document $document */ $document = $this->createsDocument->execute($booking, $object); $this->createsFile->execute($document, $object); if(!in_array($booking->company->id, [199, 510])){ $this->createPurchaseOrderFor1688OrderProcessor->execute($booking); } } }