<?php

declare(strict_types=1);

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

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

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

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

    /**
     * ZverejnenaNovaUdalostNotifikaciaMail 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 [
            'mail'
        ];
    }

    /**
     * @return string[]
     */
    public function viaQueues(): array
    {
        return [
            'mail' => 'email-notifications-queue',
        ];
    }

    /**
     * @param $notifiable
     *
     * @return \Seka\Portal\Modul\Terminy\Mail\Udalost\ZverejnenaNovaUdalostMail
     */
    public function toMail($notifiable): ZverejnenaNovaUdalostMail
    {
        return (new ZverejnenaNovaUdalostMail($this->udalost))
            ->to($notifiable);
    }
}
