<?php

declare(strict_types=1);

namespace App\Settings;

use Spatie\LaravelSettings\Settings;

/**
 * Persistent super-admin setup state.
 *
 * Currently just carries whether the SA "finish setup" checklist banner has
 * been dismissed. This lives in the settings table (a GLOBAL tenant_id = NULL
 * row, written from the Super Admin panel where no current_tenant is bound)
 * ON PURPOSE: the dismissal used to be a Cache::forever() flag, which every
 * update wipes — Super Admin > System Health "Clear caches" and
 * UpdaterService::apply() both run `cache:clear`, so the checklist kept
 * re-appearing after each update. A settings row is NOT touched by cache:clear,
 * so the dismissal survives updates. A cache flush merely forces one DB re-read.
 */
class SetupState extends Settings
{
    public bool $sa_checklist_dismissed = false;

    public static function group(): string
    {
        return 'setup';
    }
}
