-- ============================================================================
-- Update FleetManagement Module to Use Custom JavaScript
-- ============================================================================
-- Description: Updates the FleetManagement module config to include modulePath
--              so ModuleLoader loads the custom JS file instead of treating
--              it as a declarative modal-based module
-- Date: 2025-11-24
-- ============================================================================

-- Update FleetManagement module config to include modulePath
UPDATE modules
SET config = jsonb_set(
    COALESCE(config::jsonb, '{}'::jsonb),
    '{modulePath}',
    '"modules/FleetManagement"'::jsonb
)
WHERE name = 'FleetManagement';

-- Verify the update
SELECT 
    name,
    icon,
    description,
    config->>'legacy' as is_legacy,
    config->>'modulePath' as module_path
FROM modules
WHERE name = 'FleetManagement';
