const EXPENSE_SCENE_SELECTION_OPTIONS = [
  { key: 'travel', label: '差旅费', description: '出差行程、住宿、跨城交通等费用', icon: 'mdi mdi-bag-suitcase-outline', requires_application_before_reimbursement: true, next_session_type: 'application' },
  { key: 'transport', label: '交通费', description: '市内交通、打车、停车、通行等费用', icon: 'mdi mdi-car-outline', requires_application_before_reimbursement: false, next_session_type: 'expense' },
  { key: 'hotel', label: '住宿费', description: '单独住宿或酒店发票报销', icon: 'mdi mdi-bed-outline', requires_application_before_reimbursement: false, next_session_type: 'expense' },
  { key: 'meal', label: '业务招待费', description: '客户接待、工作餐、加班餐、餐饮票据等费用', icon: 'mdi mdi-food-fork-drink', requires_application_before_reimbursement: true, next_session_type: 'application' },
  { key: 'meeting', label: '会务费', description: '会议、论坛、会场、参会等费用', icon: 'mdi mdi-account-tie-voice-outline', requires_application_before_reimbursement: false, next_session_type: 'expense' },
  { key: 'office', label: '办公用品费', description: '办公用品、低值易耗品等费用', icon: 'mdi mdi-briefcase-outline', requires_application_before_reimbursement: false, next_session_type: 'expense' },
  { key: 'training', label: '培训费', description: '培训课程、讲师费、教材认证等费用', icon: 'mdi mdi-school-outline', requires_application_before_reimbursement: false, next_session_type: 'expense' },
  { key: 'communication', label: '通讯费', description: '话费、流量、宽带、网络等费用', icon: 'mdi mdi-cellphone-message', requires_application_before_reimbursement: false, next_session_type: 'expense' },
  { key: 'welfare', label: '福利费', description: '团建、体检、慰问、节日福利等费用', icon: 'mdi mdi-gift-outline', requires_application_before_reimbursement: false, next_session_type: 'expense' },
  { key: 'other', label: '其他费用', description: '暂不属于以上类型的费用', icon: 'mdi mdi-dots-horizontal-circle-outline', requires_application_before_reimbursement: false, next_session_type: 'expense' }
]

const EXPENSE_INTENT_CONFIRMATION_ACTION = {
  label: '我要报销',
  description: '按报销流程继续，并选择具体费用场景',
  icon: 'mdi mdi-receipt-text-check-outline',
  action_type: 'confirm_expense_intent'
}

export function buildExpenseSceneSelectionActions(rawText) {
  const originalMessage = String(rawText || '').trim()
  return EXPENSE_SCENE_SELECTION_OPTIONS.map((option) => ({
    label: option.label,
    description: option.description,
    icon: option.icon,
    action_type: 'select_expense_type',
    payload: {
      expense_type: option.key,
      expense_type_label: option.label,
      original_message: originalMessage,
      requires_application_before_reimbursement: option.requires_application_before_reimbursement,
      next_session_type: option.next_session_type
    }
  }))
}

export function buildExpenseIntentConfirmationActions(rawText) {
  const originalMessage = String(rawText || '').trim()
  return [{
    ...EXPENSE_INTENT_CONFIRMATION_ACTION,
    payload: {
      original_message: originalMessage
    }
  }]
}
