<?php

declare(strict_types=1);

namespace CloudXM\NFe\Providers;

use CloudXM\NFe\Bootstrap\Container;

/**
 * Queue Service Provider
 *
 * Registers queue-related services and Action Scheduler hooks
 */
class QueueServiceProvider
{
    public function __construct(
        private Container $container
    ) {}

    /**
     * Register queue services
     */
    public function register(): void
    {
        // Register NFe Queue Scheduler
        $this->container->singleton(\CloudXM\NFe\Services\NFeQueueScheduler::class);
    }

    /**
     * Boot queue services
     */
    public function boot(): void
    {
        // Register Action Scheduler hooks
        $scheduler = $this->container->get(\CloudXM\NFe\Services\NFeQueueScheduler::class);
        $scheduler->registerHooks();
    }
}
