<?php

namespace App\Notifications;

use App\Models\Lead;
use Illuminate\Notifications\Notification;

class NewLeadCapturedNotification extends Notification
{
    public function __construct(public Lead $lead)
    {
    }

    public function via(object $notifiable): array
    {
        return ['database'];
    }

    public function toArray(object $notifiable): array
    {
        return [
            'type' => 'lead_captured',
            'message' => 'New lead captured: ' . $this->lead->company_name . ' (' . $this->lead->contact_person_name . ')',
            'lead_id' => $this->lead->id,
            'url' => route('superadmin.leads.show', $this->lead),
        ];
    }
}
