<?php

declare(strict_types=1);

namespace CpCreation\VitiCore\Bridge\Symfony\Bundle\Scheduler;

use CpCreation\VitiCore\Bridge\Symfony\Bundle\Messenger\Messaging\CommandHandlerInterface;
use CpCreation\VitiCore\Marketing\DueProductReviewPublisher;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;

#[AsMessageHandler]
final readonly class PublishDueProductReviewsMessageHandler implements CommandHandlerInterface
{
    public function __construct(
        private DueProductReviewPublisher $publisher,
    ) {}

    public function __invoke(PublishDueProductReviewsMessage $message): void
    {
        $this->publisher->publish();
    }
}
