<?php
declare(strict_types=1);

namespace App\Modules\Rules;

use App\Core\Contracts\RuleEngineInterface;
use App\Modules\Rules\Services\RuleEngine;

final class RuleEngineAdapter implements RuleEngineInterface
{
    public function get(string $ruleCode, ?int $branchId = null, ?string $date = null): mixed
    {
        return RuleEngine::get($ruleCode, $branchId, $date);
    }

    public function getValue(string $ruleCode, string $key = 'value', ?int $branchId = null): mixed
    {
        return RuleEngine::getValue($ruleCode, $key, $branchId);
    }

    public function getAll(string $category, ?int $branchId = null): array
    {
        return RuleEngine::getAll($category, $branchId);
    }

    public function getEffective(string $ruleCode, string $entityType, int $entityId, ?int $branchId = null): mixed
    {
        return RuleEngine::getEffective($ruleCode, $entityType, $entityId, $branchId);
    }

    public function require(string $ruleCode, ?int $branchId = null): array
    {
        return RuleEngine::require($ruleCode, $branchId);
    }

    public function requireValue(string $ruleCode, string $key = 'value', ?int $branchId = null): mixed
    {
        return RuleEngine::requireValue($ruleCode, $key, $branchId);
    }
}
