<?php
/**
 * BookiFlex NotificationLog Extension
 *
 * @package    BookiFlex
 * @subpackage NotificationLog
 * @author     BookiFlex
 * @copyright  Copyright (c) 2025 BookiFlex
 * @license    GPL-2.0-or-later
 *
 * @link       https://bookiflex.com
 */

declare(strict_types=1);

namespace BookiFlex\Extensions\NotificationLog;

use BookiFlex\Core\Contract\ExtensionInterface;
use BookiFlex\Core\Contract\PluginInterface;
use BookiFlex\Extensions\NotificationLog\Admin\Menu\NotificationLogMenu;
use BookiFlex\Extensions\NotificationLog\Api\Controller\NotificationLogController;

defined('ABSPATH') || exit;

class NotificationLog implements ExtensionInterface
{
    public function init(PluginInterface $plugin): void
    {
        $plugin->getContainer()->register(new ServiceProvider());

        $plugin->addConfig([
            'controllers' => [
                NotificationLogController::class,
            ],
            'menus' => [
                NotificationLogMenu::class,
            ],
        ]);
    }

    public function getName(): string
    {
        return 'NotificationLog';
    }

    public function getVersion(): string
    {
        return '1.0.0';
    }

    public function isCompatible(string $pluginVersion): bool
    {
        return version_compare($pluginVersion, '1.0.0', '>=');
    }
}
