<?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 CanCreateContainer extends AbstractRule
{

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

    /**
     * CanCreateContainer 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;
    }

}
