<?php

namespace App\Notifications;

use App\Models\EventPaymentProof;

class PaymentRejectedNotification extends ArenaDatabaseNotification
{
    public function __construct(
        public EventPaymentProof $proof,
        public ?string $reason = null,
    ) {}

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

        return $this->payload(
            'notifications.payment_rejected.title',
            'notifications.payment_rejected.message',
            [
                'event' => $registration->event->title,
                'reason' => $this->reason ?? __('admin.empty.no_results'),
            ],
            route('registrations.payment-proof.create', $registration),
            'bi-x-octagon',
        );
    }
}
