From c815db0042c3fa52c9a1da67a77a0d90f7d4c870 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Sun, 5 Jul 2026 17:29:22 +0700 Subject: [PATCH] refactor: update role notifications in CuttingService to streamline admin alerts for completed cuttings --- app/Services/Manage/CuttingService.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Services/Manage/CuttingService.php b/app/Services/Manage/CuttingService.php index f54829a..bf55a54 100644 --- a/app/Services/Manage/CuttingService.php +++ b/app/Services/Manage/CuttingService.php @@ -767,7 +767,7 @@ function () use ($cutting, $status, $verificationNote, $results, $resultPrices, }; $roles = $status === CuttingStatus::COMPLETED - ? ['owner', 'developer', 'direktur', 'admin-toko'] + ? ['owner', 'developer', 'direktur'] : ['owner', 'developer', 'direktur']; $this->pushNotificationService->sendToRoles( @@ -776,6 +776,15 @@ function () use ($cutting, $status, $verificationNote, $results, $resultPrices, $roles, route('admin.manage.cuttings.index'), ); + + if ($status === CuttingStatus::COMPLETED) { + $this->pushNotificationService->sendToRoles( + $title, + $message, + ['admin-toko'], + route('admin.manage.stocks.index'), + ); + } } private function buildMaterials(array $materials): array