<?php

declare(strict_types=1);

namespace App\Notifications\Partners;

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

final class DepositSubmittedNotification extends Notification implements ShouldQueue
{
    use Queueable;

    /**
     * Create a new notification instance.
     */
    public function __construct(
        public PartnerBalanceTransaction $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' => 'Deposit Request Submitted',
            'message' => 'Your deposit request of $'.number_format((float) $this->transaction->amount, 2).' has been submitted and is pending admin approval.',
            'icon' => 'arrow-down-tray',
            'url' => route('guest.dashboard'),
            'transaction_id' => $this->transaction->id,
            'reference_id' => $this->transaction->reference_id,
            'amount' => $this->transaction->amount,
        ];
    }
}
