-- Align operation console navigation with the client top-level product tabs.
-- Keep the menu depth to two levels: root category + business entry.

INSERT INTO admin_menus (id, parent_id, title, path, icon, allowed_roles, sort_order, status)
VALUES
    (204, 200, '权限配置', '/permission-config', 'Key', 'SUPER_ADMIN,OPERATOR', 204, 1),
    (205, 200, '模型配置', '/model-config', 'Setting', 'SUPER_ADMIN,OPERATOR,READONLY', 205, 1),
    (206, 200, '用量统计', '/enterprise-usage', 'Histogram', 'SUPER_ADMIN,OPERATOR,READONLY', 206, 1)
ON DUPLICATE KEY UPDATE
    parent_id = VALUES(parent_id),
    title = VALUES(title),
    path = VALUES(path),
    icon = VALUES(icon),
    allowed_roles = VALUES(allowed_roles),
    sort_order = VALUES(sort_order),
    status = VALUES(status);

UPDATE admin_menus
   SET title = '仪表盘', icon = 'DataBoard', parent_id = 0, path = '/dashboard', sort_order = 100, status = 1
 WHERE id = 100;

UPDATE admin_menus
   SET title = '企业', icon = 'OfficeBuilding', parent_id = 0, path = NULL, sort_order = 200, status = 1
 WHERE id = 200;

UPDATE admin_menus
   SET title = '工具', icon = 'Operation', parent_id = 0, path = NULL, sort_order = 300, status = 1
 WHERE id = 400;

UPDATE admin_menus
   SET title = '费用', icon = 'Wallet', parent_id = 0, path = NULL, sort_order = 400, status = 1
 WHERE id = 300;

UPDATE admin_menus
   SET title = '支持', icon = 'Headset', parent_id = 0, path = NULL, sort_order = 500, status = 1
 WHERE id = 500;

UPDATE admin_menus
   SET title = '备案', icon = 'Finished', parent_id = 0, path = NULL, sort_order = 600, status = 1
 WHERE id = 700;

UPDATE admin_menus
   SET title = '文档', icon = 'Guide', parent_id = 0, path = NULL, sort_order = 700, status = 1
 WHERE id = 600;

UPDATE admin_menus
   SET title = '企业列表', parent_id = 200, icon = 'OfficeBuilding', sort_order = 201, status = 1
 WHERE id = 201;

UPDATE admin_menus
   SET title = '团队管理', parent_id = 200, icon = 'UserFilled', sort_order = 202, status = 1
 WHERE id = 202;

UPDATE admin_menus
   SET title = '入驻审核', parent_id = 700, icon = 'Finished', sort_order = 701, status = 1
 WHERE id = 203;

UPDATE admin_menus
   SET parent_id = 300, title = '计费记录', icon = 'Coin', sort_order = 401, status = 1
 WHERE id = 311;

UPDATE admin_menus
   SET parent_id = 300, title = '计费规则', icon = 'Money', sort_order = 402, status = 1
 WHERE id = 312;

UPDATE admin_menus
   SET parent_id = 300, title = '套餐管理', icon = 'Wallet', sort_order = 403, status = 1
 WHERE id = 313;

UPDATE admin_menus
   SET parent_id = 300, title = '订单与发票', icon = 'CreditCard', sort_order = 404, status = 1
 WHERE id = 321;

UPDATE admin_menus
   SET parent_id = 300, title = '订单操作记录', icon = 'Memo', sort_order = 405, status = 1
 WHERE id = 315;

UPDATE admin_menus
   SET parent_id = 400, title = '运营预警', icon = 'Warning', sort_order = 301, status = 1
 WHERE id = 401;

UPDATE admin_menus
   SET parent_id = 400, title = '数据报表', icon = 'Histogram', sort_order = 302, status = 1
 WHERE id = 402;

UPDATE admin_menus
   SET parent_id = 400, title = '运营账号', icon = 'Key', sort_order = 303, status = 1
 WHERE id = 711;

UPDATE admin_menus
   SET parent_id = 400, title = '全局参数', icon = 'SetUp', sort_order = 304, status = 1
 WHERE id = 721;

UPDATE admin_menus
   SET parent_id = 500, title = '工单工作台', icon = 'Tickets', sort_order = 501, status = 1
 WHERE id = 501;

UPDATE admin_menus
   SET parent_id = 500, title = '话术库', icon = 'ChatDotSquare', sort_order = 502, status = 1
 WHERE id = 502;

UPDATE admin_menus
   SET parent_id = 500, title = '客服绩效', icon = 'TrendCharts', sort_order = 503, status = 1
 WHERE id = 503;

UPDATE admin_menus
   SET parent_id = 600, title = '使用手册', icon = 'Guide', sort_order = 701, status = 1
 WHERE id = 601;

UPDATE admin_menus
   SET parent_id = 600, title = '政策与新闻', icon = 'Bell', sort_order = 702, status = 1
 WHERE id = 602;

UPDATE admin_menus
   SET parent_id = 700, title = '操作日志', icon = 'Memo', sort_order = 702, status = 1
 WHERE id = 712;

UPDATE admin_menus
   SET status = 0
 WHERE id IN (310, 320, 710, 720);
