<?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;
use Seka\Portal\Modul\Terminy\Mail\Udalost\AktualizovanaUdalostMail;

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

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

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

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

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

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