Refactor notification event payloads and listener naming
linter / quality (pull_request) Successful in 1m17s
tests / ci (8.4) (pull_request) Failing after 1m35s

This commit is contained in:
2026-04-25 21:54:42 +00:00
parent 20f89952e7
commit 61505ace23
16 changed files with 286 additions and 115 deletions
@@ -2,7 +2,6 @@
namespace App\Actions\Notifications;
use App\Enums\NotificationEventType;
use App\Models\Project;
use App\Models\Ticket;
use App\Models\TicketStatus;
@@ -17,9 +16,8 @@ class BuildTicketCreatedPayload
TicketStatus $ticketStatus,
?User $actor,
CarbonImmutable $occurredAt,
): TicketStatusChangedPayload {
return new TicketStatusChangedPayload(
eventType: NotificationEventType::TicketCreate,
): TicketCreatedPayload {
return new TicketCreatedPayload(
projectId: $project->id,
projectKey: $project->key,
projectName: $project->name,
@@ -29,8 +27,6 @@ class BuildTicketCreatedPayload
ticketUrl: route('projects.tickets.show', [$project, $ticket]),
actorId: $actor?->id,
actorName: $actor?->name,
fromStatusId: null,
fromStatusLabel: null,
toStatusId: $ticketStatus->id,
toStatusLabel: $this->statusLabel($ticketStatus),
occurredAt: $occurredAt,