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

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

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

}
