<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
use Maestro\Core\Models\NavigationNode;

/**
 * Removes Hours nav entries for history, approvals queue UI, and reports (routes retired).
 */
return new class extends Migration
{
    public function up(): void
    {
        if (! Schema::hasTable('navigation_nodes')) {
            return;
        }

        NavigationNode::query()
            ->whereIn('key', ['hours-history', 'hours-approvals', 'hours-reports'])
            ->delete();
    }

    public function down(): void
    {
        // Non-restoring: tree may have been customized via Superadmin navigation.
    }
};
