-- 合同管理菜单和权限初始化脚本

-- 1. 菜单 SQL
INSERT INTO system_menu(
    name, permission, type, sort, parent_id,
    path, icon, component, status, component_name
)
VALUES (
    '合同管理', '', 2, 6, 5055,
    'contract', 'file-text', 'asset/contract/index', 0, 'Contract'
);

-- 获取刚插入的菜单ID
SET @menuId = LAST_INSERT_ID();

-- 合同管理按钮权限
INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
VALUES
    ('合同查询', 'asset:contract:query', 3, 1, @menuId, '', '', '', 0),
    ('合同创建', 'asset:contract:create', 3, 2, @menuId, '', '', '', 0),
    ('合同更新', 'asset:contract:update', 3, 3, @menuId, '', '', '', 0),
    ('合同删除', 'asset:contract:delete', 3, 4, @menuId, '', '', '', 0),
    ('合同导出', 'asset:contract:export', 3, 5, @menuId, '', '', '', 0),
    ('提交审批', 'asset:contract:submit-approval', 3, 6, @menuId, '', '', '', 0),
    ('撤回审批', 'asset:contract:withdraw-approval', 3, 7, @menuId, '', '', '', 0),
    ('终止合同', 'asset:contract:terminate', 3, 8, @menuId, '', '', '', 0),
    ('续签合同', 'asset:contract:renew', 3, 9, @menuId, '', '', '', 0);
