From 34e082c31b605e89fdb95fc6f2aa51abf077ee86 Mon Sep 17 00:00:00 2001 From: arifal Date: Tue, 20 May 2025 11:13:21 +0700 Subject: [PATCH] fix bug sync google sheet and handle to long data address on pbg task --- app/Jobs/ScrapingDataJob.php | 2 +- app/Services/ServiceGoogleSheet.php | 2 +- ...alter_address_column_on_pbg_task_table.php | 26 +++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 database/migrations/2025_05_20_105942_alter_address_column_on_pbg_task_table.php diff --git a/app/Jobs/ScrapingDataJob.php b/app/Jobs/ScrapingDataJob.php index 7ed9416..fbe6704 100644 --- a/app/Jobs/ScrapingDataJob.php +++ b/app/Jobs/ScrapingDataJob.php @@ -79,7 +79,7 @@ class ScrapingDataJob implements ShouldQueue if (isset($import_datasource)) { $import_datasource->update([ 'status' => 'failed', - 'response_body' => 'Error: ' . $e->getMessage(), + 'response_body' => 'Terjadi kesalahan, Syncronize tidak selesai', 'finish_time' => now(), 'failed_uuid' => $failed_uuid, ]); diff --git a/app/Services/ServiceGoogleSheet.php b/app/Services/ServiceGoogleSheet.php index ae3b1bd..6a046be 100644 --- a/app/Services/ServiceGoogleSheet.php +++ b/app/Services/ServiceGoogleSheet.php @@ -107,7 +107,7 @@ class ServiceGoogleSheet 'tanggal_skrd' => $this->convertToDate($cleanValue($row[33] ?? null)), 'ptsp' => $cleanValue($row[34] ?? null), 'selesai_terbit' => $cleanValue($row[35] ?? null), - 'tanggal_pembayaran' => $cleanValue($row[36] ?? null), + 'tanggal_pembayaran' => $this->convertToDate($cleanValue($row[36] ?? null)), 'format_sts' => $cleanValue($row[37] ?? null), 'tahun_terbit' => (int) $cleanValue($row[38] ?? null), 'tahun_berjalan' => (int) $cleanValue($row[39] ?? null), diff --git a/database/migrations/2025_05_20_105942_alter_address_column_on_pbg_task_table.php b/database/migrations/2025_05_20_105942_alter_address_column_on_pbg_task_table.php new file mode 100644 index 0000000..2f67b1b --- /dev/null +++ b/database/migrations/2025_05_20_105942_alter_address_column_on_pbg_task_table.php @@ -0,0 +1,26 @@ +text('address')->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + // + } +};