<?php

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

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

class CanConfirmOrder extends AbstractRule
{
    private $confirmOrderValidation;

    public function __construct(ConfirmOrderValidation $confirmOrderValidation)
    {
        $this->confirmOrderValidation = $confirmOrderValidation;
    }

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

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

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