<?php

namespace App\Notifications;

use App\Models\Lead;
use App\Models\LeadFollowup;
use Illuminate\Notifications\Notification;

class LeadUpcomingActivityNotification extends Notification
{
    public function __construct(
        public Lead $lead,
        public LeadFollowup $followup
    ) {
    }

    public function via(object $notifiable): array
    {
        return ['database'];
    }

    public function toArray(object $notifiable): array
    {
        return [
            'type' => 'lead_upcoming_activity',
            'message' => 'Upcoming lead activity: ' . $this->lead->company_name . ' at ' . $this->followup->followup_at?->format('d M Y H:i'),
            'lead_id' => $this->lead->id,
            'followup_id' => $this->followup->id,
            'url' => route('superadmin.leads.show', $this->lead),
        ];
    }
}
