-- 新增交易管理菜单
-- 创建时间: 2025-11-13

-- 插入一级目录：交易管理
INSERT INTO menu (id, name, menu_type, icon, path, 'order', parent_id, is_hidden, component, keepalive, redirect, created_at, updated_at)
VALUES 
  (16, '交易管理', 'catalog', 'carbon:receipt', '/transaction', 3, 0, 0, 'Layout', 0, '/transaction/invoice', datetime('now'), datetime('now'));

-- 插入二级菜单：开票记录
INSERT INTO menu (id, name, menu_type, icon, path, 'order', parent_id, is_hidden, component, keepalive, redirect, created_at, updated_at)
VALUES 
  (17, '开票记录', 'menu', 'carbon:document', 'invoice', 1, 16, 0, '/transaction/invoice', 0, NULL, datetime('now'), datetime('now'));

-- 为管理员角色分配菜单权限
INSERT INTO role_menu (role_id, menu_id) 
VALUES 
  (1, 16),
  (1, 17);

-- 为普通用户角色分配菜单权限
INSERT INTO role_menu (role_id, menu_id) 
VALUES 
  (2, 16),
  (2, 17);
