<?php

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


use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\Modules\PackingLists\DataTransferObjects\PackingListObject;
use App\Classes\Modules\PackingLists\Standards\Validators\PackingListValidation;

class CanCreatePackingList extends AbstractRule
{

    /** @var PackingListValidation */
    private $packingListValidation;

    /**
     * CanCreatePackingList constructor.
     * @param PackingListValidation $packingListValidation
     */
    public function __construct(PackingListValidation $packingListValidation)
    {
        $this->packingListValidation = $packingListValidation;
    }


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

    }

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

    }


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

}
