<?php

namespace App\Notifications;

use App\Models\MarketingRequest;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;

class RequestCompletedNotification extends Notification
{
    use Queueable;

    public MarketingRequest $request;

    public function __construct(MarketingRequest $request)
    {
        $this->request = $request;
    }

    public function via(object $notifiable): array
    {
        return ['database'];
    }

    public function toArray(object $notifiable): array
    {
        return [
            'request_id' => $this->request->id,
            'request_number' => $this->request->request_number,
            'title' => 'Request Completed',
            'message' => "Marketing request {$this->request->request_number} has been marked completed.",
            'url' => route('requests.show', $this->request->id),
            'type' => 'request_completed',
        ];
    }
}
