<?php

namespace Database\Seeders;

use App\Models\TopbarNotification;
use Illuminate\Database\Seeder;

/**
 * TopbarNotificationSeeder
 *
 * Seeds 3 SSHIA-relevant sample topbar notifications.
 * Content is kept to ≤7 words per the MaxWordCount validation rule.
 *
 * Requirements: 5.6
 */
class TopbarNotificationSeeder extends Seeder
{
    public function run(): void
    {
        $notifications = [
            [
                'content'      => 'SSHIA Annual Health Conference 2026',   // 5 words
                'button_label' => 'Register Now',
                'button_url'   => '/pages/about-sshia',
                'is_active'    => true,
                'order'        => 1,
                'start_date'   => null,
                'end_date'     => null,
            ],
            [
                'content'      => 'New membership categories now available',  // 5 words
                'button_label' => 'Learn More',
                'button_url'   => '/registration/membership',
                'is_active'    => true,
                'order'        => 2,
                'start_date'   => null,
                'end_date'     => null,
            ],
            [
                'content'      => 'Health institutions directory updated',    // 5 words
                'button_label' => 'Browse Now',
                'button_url'   => '/health-directory',
                'is_active'    => true,
                'order'        => 3,
                'start_date'   => null,
                'end_date'     => null,
            ],
        ];

        foreach ($notifications as $data) {
            TopbarNotification::firstOrCreate(
                ['content' => $data['content']],
                $data
            );
        }

        $this->command->info('TopbarNotification seeder: 3 sample notifications created.');
    }
}
