<?php

namespace App\Classes\Modules\PackingLists\Standards\Rules\Containers;


use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\Modules\PackingLists\DataTransferObjects\ContainerObject;
use App\Classes\Modules\PackingLists\Standards\Validators\ContainerValidation;

class CanUpdateContainer extends AbstractRule
{

    /** @var ContainerValidation */
    private $ContainerValidation;

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


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

    }

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

    }


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

}
