<?php

declare(strict_types=1);

/*
 * This file is part of the Ferienpass package.
 *
 * (c) Richard Henkenjohann <richard@ferienpass.online>
 *
 * For more information visit the project website <https://ferienpass.online>
 * or the documentation under <https://docs.ferienpass.online>.
 */

namespace Ferienpass\CoreBundle\Message;

use Ferienpass\CoreBundle\Entity\Attendance;

/**
 * Dispatched when an unauthenticated visitor asks to withdraw an attendance from
 * the confirmation page. The handler sends an e-mail confirmation link the
 * visitor must click to actually perform the withdrawal — the same "prove you
 * control the mailbox" second factor the e-mail confirmation uses, so a shared or
 * forwarded page link cannot trigger the irreversible withdrawal on its own.
 */
class AttendanceWithdrawRequested implements LoggableMessageInterface
{
    public function __construct(private readonly string $attendance)
    {
    }

    public function getAttendance(): string
    {
        return $this->attendance;
    }

    public function getRelated(): array
    {
        return [
            Attendance::class => $this->attendance,
        ];
    }
}
