<?php

namespace App\Notifications;

use App\Models\EventRegistration;
use Illuminate\Notifications\Messages\MailMessage;

class EventRegistrationReceivedNotification extends ArenaDatabaseNotification
{
    public function __construct(public EventRegistration $registration) {}

    public function toArray(object $notifiable): array
    {
        $event = $this->registration->event;

        return $this->payload(
            'notifications.event_registration_received.title',
            'notifications.event_registration_received.message',
            ['event' => $event->title],
            route('registrations.show', $this->registration),
            'bi-clipboard-check',
        );
    }

    public function toMail(object $notifiable): MailMessage
    {
        return (new MailMessage)
            ->subject(__('notifications.event_registration_received.title'))
            ->line(__('notifications.event_registration_received.message', [
                'event' => $this->registration->event->title,
            ]));
    }
}
