<?php

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


use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\Modules\Remarks\DataTransferObjects\RemarkObject;
use App\Classes\Modules\Remarks\Standards\Validators\RemarkValidation;

class CanCreateRemark extends AbstractRule
{

    /** @var RemarkValidation */
    private $RemarkValidation;

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


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

    }

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

    }


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

}
