<?php

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

use App\Classes\General\Abstracts\AbstractRule;
use App\Classes\Modules\Currencies\DataTransferObjects\CurrencyObject;
use App\Classes\Modules\Currencies\Standards\Validators\CurrencyValidation;

class CanCreateCurrency extends AbstractRule
{

    /** @var currencyValidation */
    private $currencyValidation;

    /**
     * CanCreateCurrency constructor.
     * @param CurrencyValidation $currencyValidation
     */
    public function __construct(CurrencyValidation $currencyValidation)
    {
        $this->currencyValidation = $currencyValidation;
    }

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

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

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