Refactor notification event payloads and listener naming
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user