<?php

declare(strict_types=1);

namespace BookiFlex\Extensions\NotificationPreview;

use BookiFlex\Core\Contract\ExtensionInterface;
use BookiFlex\Core\Contract\PluginInterface;
use BookiFlex\Extensions\NotificationPreview\Api\Controller\NotificationPreviewController;

defined( 'ABSPATH' ) || exit;

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

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

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

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

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