const VALID_PERSONAS = ['admin', 'clinic_salesperson'];

/**
 * 构建医生小程序登录/切换账号的附加参数（仅 admin 多身份传 login_persona）
 * @param {Record<string, any>} account
 */
export function buildDoctorWxAuthExtra(account) {
  const extra = {
    account_type: account.account_type,
    account_id: account.id,
  };
  if (
    account.account_type === 'admin'
    && VALID_PERSONAS.includes(account.login_persona)
  ) {
    extra.login_persona = account.login_persona;
  }
  return extra;
}
