<?php

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

use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\Modules\Orders\Standards\Validators\OrderRoleValidation;

class CanCreateOrderRole extends AbstractRule
{
    private $orderRoleValidation;

    public function __construct(OrderRoleValidation $orderRoleValidation)
    {
        $this->orderRoleValidation = $orderRoleValidation;
    }

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

    protected function validators($object): bool
    {
        return $this->orderRoleValidation->validate($object);
    }

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