Implement WasteCollected push notification and fix empty collection history issue
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user