<?php

declare(strict_types=1);

namespace Seka\Terminy\Listeners\Udalost;

use Seka\Terminy\Events\Udalost\Udalost;
use Seka\Terminy\Dtos\Factory\UdalostDTOFactory;

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

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