From af1f4e787b77efc5661f14cd6ade519283028a83 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Thu, 15 Jan 2026 04:11:52 +0800 Subject: [PATCH] 1688 PO Automation Project --- .../V2/ETLPurchaseOrderTransactionV2CommandJob.php | 2 +- .../ImportPurchaseOrderTransactionLogic.php | 4 ++-- .../Processors/ETLPDFPurchaseOrderClaudeProcessor.php | 7 +------ 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/app/Classes/Jobs/Commands/V2/ETLPurchaseOrderTransactionV2CommandJob.php b/app/Classes/Jobs/Commands/V2/ETLPurchaseOrderTransactionV2CommandJob.php index 6166646d..9222eaa9 100644 --- a/app/Classes/Jobs/Commands/V2/ETLPurchaseOrderTransactionV2CommandJob.php +++ b/app/Classes/Jobs/Commands/V2/ETLPurchaseOrderTransactionV2CommandJob.php @@ -75,7 +75,7 @@ class ETLPurchaseOrderTransactionV2CommandJob implements ShouldQueue 'file_count' => count($this->files), ]); - (App()->make(ETLPDFPurchaseOrderClaudeProcessor::class))->execute($this->files, $this->bookingId, $this->batchIndex !== 1, $this->isLast); + (App()->make(ETLPDFPurchaseOrderClaudeProcessor::class))->execute($this->files, $this->bookingId, $this->batchIndex !== 1); $cacheKey = 'etl_finished_jobs_' . $this->groupId; $lockKey = $cacheKey . '_lock'; diff --git a/app/Classes/Modules/Transactions/ControllersLogic/ImportPurchaseOrderTransactionLogic.php b/app/Classes/Modules/Transactions/ControllersLogic/ImportPurchaseOrderTransactionLogic.php index bf8cc2f4..bd26ed8e 100644 --- a/app/Classes/Modules/Transactions/ControllersLogic/ImportPurchaseOrderTransactionLogic.php +++ b/app/Classes/Modules/Transactions/ControllersLogic/ImportPurchaseOrderTransactionLogic.php @@ -166,8 +166,8 @@ class ImportPurchaseOrderTransactionLogic extends AbstractControllerLogic if ($totalSize > $maxSize) { // ETLPurchaseOrderTransactionV2CommandJob::dispatch($base64FilesEN, $request->route('id')); $this->runAsJob($base64FilesEN, $request->route('id')); - // $this->notificationMessage = "Please don’t refresh the page. The page will automatically update when the process is done."; - $this->notificationMessage = "Please refresh page in a few minutes"; + $this->notificationMessage = "Please don’t refresh the page. The page will automatically update when the process is done."; + // $this->notificationMessage = "Please refresh page in a few minutes"; return $this->response([]); } else{ diff --git a/app/Classes/Modules/Transactions/Processors/ETLPDFPurchaseOrderClaudeProcessor.php b/app/Classes/Modules/Transactions/Processors/ETLPDFPurchaseOrderClaudeProcessor.php index 53f6ade3..80559ab3 100644 --- a/app/Classes/Modules/Transactions/Processors/ETLPDFPurchaseOrderClaudeProcessor.php +++ b/app/Classes/Modules/Transactions/Processors/ETLPDFPurchaseOrderClaudeProcessor.php @@ -49,7 +49,7 @@ class ETLPDFPurchaseOrderClaudeProcessor * @param bool $append * @return array|null */ - public function execute(array $files, ?int $bookingId = null, bool $append = false, bool $broadcast = false): ?array + public function execute(array $files, ?int $bookingId = null, bool $append = false): ?array { $tempPaths = []; @@ -132,7 +132,6 @@ class ETLPDFPurchaseOrderClaudeProcessor }); Log::info('total: '. (string) $total); - Log::info('broadcast: '. json_encode($broadcast)); $object = new TransactionObject( $billNumber, @@ -154,10 +153,6 @@ class ETLPDFPurchaseOrderClaudeProcessor ); $this->createPurchaseOrderTransactionProcessor->execute($booking, $object, $append); - - // if($broadcast){ - // ETLPurchaseOrderTransactionCompleteV2CommandJob::dispatch(true, $bookingId)->delay(now()->addSeconds(20)); - // } } return $data;