<?php

declare(strict_types=1);

namespace App\Notifications\Payments;

use App\Models\Transaction;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Notification;

final class PaymentVerified extends Notification implements ShouldQueue
{
    use Queueable;

    public function __construct(
        public Transaction $transaction
    ) {}

    /**
     * Get the notification's delivery channels.
     *
     * @return array<int, string>
     */
    public function via(object $notifiable): array
    {
        return ['database'];
    }

    /**
     * Get the array representation of the notification.
     *
     * @return array<string, mixed>
     */
    public function toArray(object $notifiable): array
    {
        return [
            'title' => 'Payment Verified',
            'message' => 'Your payment for '.$this->transaction->property->title.' has been verified!',
            'icon' => 'check-circle',
            'url' => route('guest.dashboard'),
            'transaction_id' => $this->transaction->id,
            'booking_id' => $this->transaction->booking_id,
        ];
    }
}
