<?php

declare(strict_types=1);

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

use Seka\Portal\Modul\Terminy\Events\Udalost\Udalost;
use Seka\Portal\Modul\Terminy\Entities\Dtos\Factory\UdalostDTOFactory;

/**
 * Class ZrusitUdalostVKalendari
 *
 * @package Seka\Portal\Modul\Terminy\Listeners\Udalost
 */
final class ZrusitUdalostVKalendari extends UdalostVKlendari
{
    /**
     * @param \Seka\Portal\Modul\Terminy\Events\Udalost\Udalost $event
     */
    public function handle(Udalost $event): void
    {
        $udalost = UdalostDTOFactory::make($event->udalost);

        $this->calendarService->deleteEvent($udalost);
    }
}
