<?php

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


use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\Modules\Accounts\DataTransferObjects\UserObject;
use App\Classes\Modules\Accounts\Standards\Validators\UserUpdateValidation;

class CanUpdateUser extends AbstractRule
{

    /** @var UserUpdateValidation */
    private $userUpdateValidation;

    /**
     * CanUpdateAddress constructor.
     * @param UserUpdateValidation $userUpdateValidation
     */
    public function __construct(UserUpdateValidation $userUpdateValidation)
    {
        $this->userUpdateValidation = $userUpdateValidation;
    }


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

    }

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

    }


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

}