<?php

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


use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\Modules\ServiceTypes\DataTransferObjects\ServiceTypeObject;
use App\Classes\Modules\ServiceTypes\Standards\Validators\ServiceTypeValidation;

class CanCreateServiceType extends AbstractRule
{

    /** @var ServiceTypeValidation */
    private $serviceTypeValidation;

    /**
     * CanCreateServiceType constructor.
     * @param ServiceTypeValidation $serviceTypeValidation
     */
    public function __construct(ServiceTypeValidation $serviceTypeValidation)
    {
        $this->serviceTypeValidation = $serviceTypeValidation;
    }


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

    }

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

    }


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

}