2020-10-01 04:10:28 +05:30
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace common\notifications;
|
|
|
|
|
|
|
|
use common\models\Account;
|
|
|
|
use Webmozart\Assert\Assert;
|
|
|
|
|
2024-12-02 15:40:55 +05:30
|
|
|
final readonly class AccountDeletedNotification implements NotificationInterface {
|
2020-10-01 04:10:28 +05:30
|
|
|
|
|
|
|
private Account $account;
|
|
|
|
|
|
|
|
public function __construct(Account $account) {
|
|
|
|
Assert::notNull($account->deleted_at, 'Account must be deleted');
|
|
|
|
$this->account = $account;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getType(): string {
|
|
|
|
return 'account.deletion';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getPayloads(): array {
|
|
|
|
return [
|
|
|
|
'id' => $this->account->id,
|
|
|
|
'uuid' => $this->account->uuid,
|
|
|
|
'username' => $this->account->username,
|
|
|
|
'email' => $this->account->email,
|
|
|
|
'registered' => date('c', $this->account->created_at),
|
|
|
|
'deleted' => date('c', $this->account->deleted_at),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|