export function mapPreReviewFindingsToRiskFlags(preReview = {}) {
  const findings = Array.isArray(preReview?.findings) ? preReview.findings : []
  return findings.map((finding) => ({
    ...finding,
    source: String(finding?.source || 'pre_review_finding').trim() || 'pre_review_finding',
    label: finding?.message || '提交前预审风险',
    business_stage: String(
      finding?.business_stage || finding?.businessStage || 'reimbursement'
    ).trim() || 'reimbursement',
    risk_domain: finding?.risk_domain || finding?.riskDomain || '',
    visibility_scope: finding?.visibility_scope || finding?.visibilityScope || ''
  }))
}
