<?php
declare(strict_types=1);
namespace App\V4\Webhook\Message;
use App\V4\Event\PostPersistEvent;
use DateTimeImmutable;
class WebhookTriggeredMessage
{
/**
* @var string
*/
private $eventId;
/**
* @var PostPersistEvent
*/
private $event;
/**
* @var string
*/
private $webhookId;
/**
* @var string
*/
private $customerId;
/**
* @var DateTimeImmutable
*/
private $triggeredAt;
public function __construct(PostPersistEvent $event, string $webhookId, string $customerId)
{
$this->event = $event;
$this->webhookId = $webhookId;
$this->customerId = $customerId;
$this->eventId = uniqid();
$this->triggeredAt = new DateTimeImmutable();
}
public function getEventId(): string
{
return $this->eventId;
}
public function getEvent(): PostPersistEvent
{
return $this->event;
}
public function getWebhookId(): string
{
return $this->webhookId;
}
public function getCustomerId(): string
{
return $this->customerId;
}
public function getTriggeredAt(): DateTimeImmutable
{
return $this->triggeredAt;
}
}