<?php

namespace Seka\Portal\Modul\Vzdelavanie\Providers;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Support\ServiceProvider;
use Seka\Portal\Modul\Vzdelavanie\Commands\Console\SpracovanieNevyhodnotenychTestov;

/**
 * Class ScheduleServiceProvider
 *
 * @package Seka\Portal\Modul\Vzdelavanie\Providers
 */
class ScheduleServiceProvider extends ServiceProvider
{
    /**
     * @throws \Illuminate\Contracts\Container\BindingResolutionException
     * @throws \Psr\Container\ContainerExceptionInterface
     */
    public function boot(): void
    {
        $this->callAfterResolving(Schedule::class, function (Schedule $schedule) {
            $schedule
                ->command(SpracovanieNevyhodnotenychTestov::class)
                ->withoutOverlapping()
                ->monthlyOn(dayOfMonth: 15, time: '04:30')
                ->emailOutputTo('logs@seka.sk');
        });
    }
}