<?php

namespace App\Classes\Modules\Schedules\Standards\Rules;


use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
use App\Classes\Modules\Schedules\Standards\Validators\ScheduleValidation;

class CanCreateSchedule extends AbstractRule
{

    /** @var ScheduleValidation */
    private $ScheduleValidation;

    /**
     * CanCreateSchedule constructor.
     * @param ScheduleValidation $ScheduleValidation
     */
    public function __construct(ScheduleValidation $ScheduleValidation)
    {
        $this->ScheduleValidation = $ScheduleValidation;
    }


    /**
     * @return bool
     */
    protected function authorized(): bool
    {
        // TODO  Set Authorization rules
        return true;

    }

    /**
     * @param ScheduleObject $object
     * @return bool
     * @throws \App\Classes\Exceptions\RequestValidationException
     */
    protected function validators($object): bool
    {
        return $this->ScheduleValidation->validate($object);

    }


    /**
     * @param ScheduleObject $object
     * @return bool
     */
    protected function criteria($object): bool
    {
        return true;
    }

}
