<?php

namespace Functional\Users\Notifications;

use Illuminate\Notifications\Notification;
use NotificationChannels\WebPush\WebPushChannel;
use NotificationChannels\WebPush\WebPushMessage;

/** Notification de test envoyée quand l'utilisateur active/teste les rappels push. */
class PushTestNotification extends Notification
{
    /** @return array<int,string> */
    public function via(object $notifiable): array
    {
        return [WebPushChannel::class];
    }

    public function toWebPush(object $notifiable): WebPushMessage
    {
        return (new WebPushMessage())
            ->title('🔥 StreakFit')
            ->body('Notifications activées — on te préviendra pour garder ta flamme !')
            ->icon('/pwa-192.png')
            ->badge('/pwa-192.png')
            ->data(['url' => '/'])
            ->options(['TTL' => 3600]);
    }
}
