<?php

namespace App\Notifications;

use App\Http\Controllers\Dashboard\NotificationController;
use App\Models\AppData;
use GuzzleHttp\Client;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;

class WithdrawRequestAcceptNotification extends Notification
{
    use Queueable;
    protected $amount;
    protected $fcm;

    public function __construct($amount, $fcm)
    {
        $this->amount = $amount;
        $this->fcm = $fcm;
    }

    public function via()
    {
        return $this->toFcm();
    }


    public function toFcm()
    {
        if ($this->fcm == null) {
            return;
        }
        $title = "Withdraw Request Accepted";
        $body = "Your withdrawal of ₹" . $this->amount . " has been Approved";
        NotificationController::sendNotificationToUser($this->fcm, $title, $body);
    }
}
