Implement WasteCollected push notification and fix empty collection history issue

This commit is contained in:
ramram1515
2026-07-03 12:46:55 +08:00
parent db82d076b5
commit 2b74bb4264
3 changed files with 74 additions and 4 deletions

View File

@@ -123,6 +123,15 @@ class ScanService
$this->qrAllocator->notifyBalanceIfLow($code->household);
}
// Notify the resident about the collection
$notifiable = $code->household?->head ?? $code->user;
if ($notifiable) {
\Illuminate\Support\Facades\Notification::send(
$notifiable,
new \App\Notifications\WasteCollected($log)
);
}
return ScanResult::accepted($code->fresh(), $log);
});
}