Move notification event type onto events
linter / quality (pull_request) Successful in 1m28s
tests / ci (8.4) (pull_request) Successful in 1m46s

This commit is contained in:
2026-04-29 09:35:31 +00:00
parent 4832e7f984
commit ff5e54cad7
10 changed files with 26 additions and 29 deletions
@@ -12,11 +12,12 @@ class QueueNotificationEventDeliveries
public function handle(NotificationEvent $event): void
{
$payload = $event->payload();
$eventType = $event->eventType();
NotificationAction::query()
->enabled()
->where('project_id', $payload->projectId())
->where('event_type', $payload->eventType()->value)
->where('event_type', $eventType->value)
->get(['channel', 'id'])
->each(function (NotificationAction $notificationAction) use ($event, $payload): void {
$notificationDeliveryLogId = null;
@@ -26,7 +27,7 @@ class QueueNotificationEventDeliveries
'attempt_count' => 0,
'channel' => $notificationAction->channel,
'delivery_status' => NotificationDeliveryStatus::Pending,
'event_type' => $payload->eventType(),
'event_type' => $event->eventType(),
'notification_action_id' => $notificationAction->id,
'payload_metadata' => $payload->deliveryMetadata(),
])->id;