<?php

declare(strict_types=1);

namespace Seka\Portal\Modul\Terminy\Listeners\Registracia;

use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Notification;
use Seka\Portal\Modul\Terminy\Events\Registracia\ZrusenaRegistraciaNaUdalost;
use Seka\Portal\Modul\Terminy\Notifications\Registracia\ZrusenaRegistraciaNotifikacia;

/**
 * Class ZrusenaRegistraciaNaUdalostListener
 *
 * @package Seka\Portal\Modul\Terminy\Listeners\Registracia
 */
final class ZrusenaRegistraciaNaUdalostListener implements ShouldQueue
{
    /**
     * @throws \Illuminate\Contracts\Container\BindingResolutionException
     */
    public function handle(ZrusenaRegistraciaNaUdalost $event): void
    {
        Notification::send(
            $event->notifiable,
            new ZrusenaRegistraciaNotifikacia($event->registracia),
        );
    }
}
