-- ============================================================================
-- 租户库 fs_tenant_*.company_menu —— 通用模板（company_id=NULL）
-- 每个租户库都要执行
-- ============================================================================

INSERT IGNORE INTO company_menu
  (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, company_id)
VALUES
(2994, '对话测试与质量', 2951, 5, 'lobsterChatTest', NULL, 1, 0, 'M', '0', '0', NULL, 'message', 'admin', NOW(), NULL),
(2995, '多模型与配置',   2951, 6, 'lobsterConfig',   NULL, 1, 0, 'M', '0', '0', NULL, 'tools',   'admin', NOW(), NULL),
(2996, '任务执行(实例监控)', 2993, 1, 'lobster-instance',    'lobster/instance/index',    1, 0, 'C', '0', '0', 'workflow:lobster:instance', 'monitor', 'admin', NOW(), NULL),
(2997, 'Token消耗统计',      2993, 5, 'lobster-token-stats', 'lobster/token-stats/index', 1, 0, 'C', '0', '0', 'workflow:lobster:token',    'coin',    'admin', NOW(), NULL),
(2998, '用户画像配置', 2992, 3, 'lobster-profile-config',  'lobster/profile-config/index',  1, 0, 'C', '0', '0', 'workflow:lobster:profile',   'user',     'admin', NOW(), NULL),
(2999, '摘要生成配置', 2992, 4, 'lobster-summary-config',  'lobster/summary-config/index',  1, 0, 'C', '0', '0', 'workflow:lobster:summary',   'notebook', 'admin', NOW(), NULL),
(3000, '消息去重配置', 2992, 5, 'lobster-dedup-config',    'lobster/dedup-config/index',    1, 0, 'C', '0', '0', 'workflow:lobster:dedup',     'filter',   'admin', NOW(), NULL),
(3001, '敏感词库',     2992, 6, 'lobster-sensitive-words', 'lobster/sensitive-words/index', 1, 0, 'C', '0', '0', 'workflow:lobster:sensitive', 'warning',  'admin', NOW(), NULL),
(3002, '聚合聊天',       2994, 1, 'lobster-chat-aggregate', 'lobster/chat-aggregate/index', 1, 0, 'C', '0', '0', 'workflow:lobster:chat',     'message',         'admin', NOW(), NULL),
(3003, '模拟聊天测试',   2994, 2, 'lobster-chat-test',      'lobster/chat-test/index',      1, 0, 'C', '0', '0', 'workflow:lobster:chattest', 'chat-dot-square', 'admin', NOW(), NULL),
(3004, '评分准确性验证', 2994, 3, 'lobster-quality-verify', 'lobster/quality-verify/index', 1, 0, 'C', '0', '0', 'workflow:lobster:quality',  'data-analysis',   'admin', NOW(), NULL),
(3005, '多模型路由配置', 2995, 1, 'lobster-model-route',    'lobster/model-route/index',    1, 0, 'C', '0', '0', 'workflow:lobster:modelroute', 'guide', 'admin', NOW(), NULL);

-- 同时也补全本租户的龙虾基础菜单（在 sys_menu 中已存在，这里 company_menu 缺）
INSERT IGNORE INTO company_menu
  (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, company_id)
VALUES
(2951, '龙虾引擎',     0,    20, 'lobster',                 NULL,                          1, 0, 'M', '0', '0', NULL,                          'system',        'admin', NOW(), NULL),
(2976, '工作流',       2951, 1,  'lobsterWorkflow',         NULL,                          1, 0, 'M', '0', '0', NULL,                          'component',     'admin', NOW(), NULL),
(2992, '语料与提示词', 2951, 3,  'lobsterCorpus',           NULL,                          1, 0, 'M', '0', '0', NULL,                          'documentation', 'admin', NOW(), NULL),
(2993, '运维监控',     2951, 4,  'lobsterOps',              NULL,                          1, 0, 'M', '0', '0', NULL,                          'monitor',       'admin', NOW(), NULL),
(2973, '工作流模板库', 2976, 1,  'lobster-template',        'lobster/template/index',      1, 0, 'C', '0', '0', 'workflow:lobster:edit',       'documentation', 'admin', NOW(), NULL),
(2953, '提示词管理',   2992, 1,  'lobster-prompt',          'lobster/prompt/index',        1, 0, 'C', '0', '0', 'workflow:lobster:prompt',     'edit',          'admin', NOW(), NULL),
(2954, '销冠语料学习', 2992, 2,  'lobster-sales-corpus',    'lobster/sales-corpus/index',  1, 0, 'C', '0', '0', 'workflow:lobster:corpus',     'star',          'admin', NOW(), NULL),
(2955, '接口注册中心', 2993, 2,  'lobster-api-registry',    'lobster/api-registry/index',  1, 0, 'C', '0', '0', 'workflow:lobster:api',        'nested',        'admin', NOW(), NULL),
(2956, '死信队列',     2993, 3,  'lobster-dead-letter',     'lobster/dead-letter/index',   1, 0, 'C', '0', '0', 'workflow:lobster:deadletter', 'bug',           'admin', NOW(), NULL),
(2957, '节点审核',     2993, 4,  'lobster-event-audit',     'lobster/event-audit/index',   1, 0, 'C', '0', '0', 'workflow:lobster:audit',      'checkbox',      'admin', NOW(), NULL),
(2952, 'AI优化建议',   2993, 6,  'lobster-optimization',    'lobster/optimization/index',  1, 0, 'C', '0', '0', 'workflow:lobster:optimization','eye-open',     'admin', NOW(), NULL);

-- 隐藏不需要展示的菜单（仅当存在时生效）
UPDATE company_menu SET visible = '1'
WHERE menu_id IN (2960,2961,2962,2963,2964,2965,2966,2967,2969,2970,2971,2972,2974,2975)
  AND parent_id IN (2951,2976);
