1
0

Giant Update

This commit is contained in:
Wian Drs
2026-07-31 13:57:11 +07:00
parent f68d967c8b
commit b0d08211ec
112 changed files with 6674 additions and 3 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
namespace App\Jobs;
use App\Models\NotificationBroadcast;
use App\Services\Notification\NotificationService;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
class ProcessBroadcast implements ShouldQueue
{
use Queueable;
public int $tries = 3;
public function __construct(public int $broadcastId) {}
public function handle(NotificationService $service): void
{
$broadcast = NotificationBroadcast::with(['tenant', 'template', 'channelConfig'])->find($this->broadcastId);
if ($broadcast) {
$service->processBroadcast($broadcast);
}
}
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace App\Jobs;
use App\Models\NotificationDelivery;
use App\Services\Notification\NotificationManager;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
class ProcessNotificationDelivery implements ShouldQueue
{
use Queueable;
public int $tries = 5;
public function __construct(public int $deliveryId) {}
public function backoff(): array
{
return [60, 300, 900, 3600];
}
public function handle(NotificationManager $manager): void
{
$delivery = NotificationDelivery::find($this->deliveryId);
if (! $delivery || in_array($delivery->status, ['sent', 'delivered', 'read', 'cancelled', 'skipped'], true)) {
return;
}
$manager->deliver($delivery);
}
}