<?php

declare(strict_types=1);

namespace Seka\Portal\Modul\Terminy\Notifications\Udalost;

use Illuminate\Bus\Queueable;
use Seka\Portal\Modul\Terminy\Entities\Dtos\UdalostDTO;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;

/**
 * Class ZverejnenaNovaUdalostNotifikaciaDB
 *
 * @package Seka\Portal\Modul\Terminy\Notifications\Udalost
 */
final class ZverejnenaNovaUdalostNotifikaciaDB extends Notification implements ShouldQueue
{
    use Queueable;

    /**
     * @var \Seka\Portal\Modul\Terminy\Entities\Dtos\UdalostDTO
     */
    public UdalostDTO $udalost;

    /**
     * ZverejnenaNovaUdalostNotifikaciaDB constructor.
     *
     * @param \Seka\Portal\Modul\Terminy\Entities\Dtos\UdalostDTO $udalost
     */
    public function __construct(UdalostDTO $udalost)
    {
        $this->udalost = $udalost;
    }

    /**
     * @return string[]
     */
    public function via(): array
    {
        return [
            'database',
        ];
    }

    /**
     * @param $notifiable
     *
     * @return array
     */
    public function toDatabase($notifiable): array
    {
        return $this->udalost->toArray();
    }
}
