<?php

namespace WPSN\Modules\BulkTable;

use WPSN\Core\AbstractModule;
use WPSN\Modules\BulkTable\Admin\BulkTableAdmin;
use WPSN\Modules\BulkTable\BulkTableJobs;

defined('ABSPATH') || exit;

/**
 * Bulk Operations (table): spreadsheet-like editor for SEO overrides + CSV import/export.
 *
 * This implements the "bulk-table + CSV dry-run+diff" item from the roadmap.
 */
final class BulkTableModule extends AbstractModule
{
    public function id(): string
    {
        return 'bulk_table';
    }

    public function name(): string
    {
        return __('Bulk Table', 'wp-seo-next');
    }

    public function description(): string
    {
        return __('Spreadsheet-like bulk editor for SEO meta/social/robots with CSV import/export and dry-run diff preview.', 'wp-seo-next');
    }

    public function defaultEnabled(): bool
    {
        // Admin-only feature.
        return true;
    }

    public function register(): void
    {
        // Queue jobs must be registered in ALL contexts (cron/front-end),
        // otherwise queue processing may not have a handler.
        (new BulkTableJobs($this->container))->register();

        if (is_admin()) {
            (new BulkTableAdmin($this->container))->register();
        }
    }
}
