-- 为用户 sxn 创建坐席记录，并设置初始密码
-- 密码: admin123 (bcrypt hash)
INSERT INTO agents (id, user_id, name, status, current_load, max_load, created_at, updated_at, role, skill_tags, password_hash)
VALUES (
    'agent-sxn-001',
    'sxn',
    '宋献',
    'offline',
    0,
    5,
    NOW(),
    NOW(),
    'agent',
    '[]',
    '$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewY5ePLF3Sp.c6O'
) ON CONFLICT (user_id) DO UPDATE SET
    name = '宋献',
    password_hash = '$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewY5ePLF3Sp.c6O';

-- 验证
SELECT user_id, name, status, role FROM agents WHERE user_id = 'sxn';
