update staff_roles
set
  description = '负责商品、优惠码、专家审核、活动报名、合作咨询和订单只读。',
  permissions = array[
    'product:read', 'product:write', 'coupon:read', 'coupon:write',
    'order:read', 'event:read',
    'cooperation:read', 'cooperation:update',
    'expert_profile:read', 'expert_profile:write',
    'expert_application:read', 'expert_application:review',
    'expert_booking:read', 'expert_booking:update',
    'expert_schedule:read', 'expert_schedule:write',
    'user:read'
  ]::text[],
  updated_at = now()
where code = 'operations_admin';

update staff_roles
set
  description = '负责资讯、首页、关于我们、规划咨询、协议等站点内容配置。',
  permissions = array[
    'news:read', 'news:write',
    'expert_profile:read', 'expert_profile:write',
    'site:read', 'site:write'
  ]::text[],
  updated_at = now()
where code = 'content_admin';

update staff_roles
set
  description = '负责订单、支付、平台收入、专家分账、提现和对账导出。',
  permissions = array['order:read', 'payment:read', 'settlement:read', 'reconcile:export', 'coupon:read']::text[],
  updated_at = now()
where code = 'finance_admin';

update staff_roles
set
  description = '负责课程和活动报名名单查看与核销。',
  permissions = array['event:read', 'event:checkin']::text[],
  updated_at = now()
where code = 'checkin_staff';

update products
set status = 'offline', updated_at = now()
where status = 'published'
  and (
    id in (
      'agent-admin-052741',
      'agent-test-agent-for-test-period',
      'agent-second-test',
      'agent-ceshiceshiceshi',
      'data-ceshibaogao',
      'agent-daguanjia',
      'data-wodedashuju'
    )
    or title in (
      '后台发布测试智能体',
      '测试智能体测试',
      '我的大管家',
      '我的大数据',
      '测试报告'
    )
  );
