<?php

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


use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\Modules\Transports\DataTransferObjects\TransportObject;
use App\Classes\Modules\Transports\Standards\Validators\TransportValidation;

class CanUpdateTransport extends AbstractRule
{

    /** @var TransportValidation */
    private $TransportValidation;

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


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

    }

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

    }


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

}
