<?php

namespace App\Waitlist\MessageHandler;

use App\Waitlist\Message\ExpireWaitlistMessage;
use App\Waitlist\Service\WaitlistExpirer;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;

#[AsMessageHandler]
final class ExpireWaitlistHandler
{
    public function __construct(private readonly WaitlistExpirer $expirer) {}

    public function __invoke(ExpireWaitlistMessage $message): void
    {
        $this->expirer->expire();
    }
}
