<?php

declare(strict_types=1);

namespace Seka\Terminy\Notifications\Udalost;

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

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

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

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

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

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