import { TRANSPORT_KEYWORD_PATTERN } from '../../utils/reimbursementTextInference.js'

export const DOCUMENT_TYPE_LABELS = {
  travel_ticket: '行程单/机票/车票',
  flight_itinerary: '机票/航班行程单',
  train_ticket: '火车/高铁票',
  ship_ticket: '轮船票',
  hotel_invoice: '酒店住宿票据',
  taxi_receipt: '出租车/网约车票据',
  parking_toll_receipt: '停车/通行费票据',
  transport_receipt: '交通出行票据',
  meal_receipt: '餐饮票据',
  office_invoice: '办公用品票据',
  meeting_invoice: '会议/会务票据',
  training_invoice: '培训票据',
  vat_invoice: '增值税发票',
  receipt: '一般收据/凭证',
  other: '其他单据'
}

export const EXPENSE_TYPE_LABELS = {
  travel: '差旅费',
  hotel: '住宿费',
  transport: '交通费',
  meal: '业务招待费',
  meeting: '会务费',
  entertainment: '业务招待费',
  marketing: '市场推广费',
  office: '办公用品费',
  training: '培训费',
  software: '软件服务费',
  communication: '通讯费',
  welfare: '福利费',
  other: '其他费用'
}

export const REVIEW_SLOT_CONFIG = {
  expense_type: {
    title: '报销分类',
    hint: '请选择本次报销分类',
    status: '待确认',
    icon: 'mdi mdi-shape-outline'
  },
  customer_name: {
    title: '关联客户',
    hint: '请补充客户单位全称',
    status: '待补充',
    icon: 'mdi mdi-domain'
  },
  time_range: {
    title: '发生时间',
    hint: '请按 YYYY-MM-DD 补充业务发生日期',
    status: '待补充',
    icon: 'mdi mdi-calendar-month-outline'
  },
  location: {
    title: '业务地点',
    hint: '请补充业务发生地点',
    status: '待补充',
    icon: 'mdi mdi-map-marker-outline'
  },
  merchant_name: {
    title: '酒店/商户',
    hint: '请补充酒店或商户名称',
    status: '待补充',
    icon: 'mdi mdi-storefront-outline'
  },
  amount: {
    title: '金额',
    hint: '请补充本次费用金额',
    status: '待补充',
    icon: 'mdi mdi-cash'
  },
  reason: {
    title: '场景 / 事由',
    hint: '请补充本次费用场景或事由',
    status: '待补充',
    icon: 'mdi mdi-text-box-outline'
  },
  participants: {
    title: '同行人员',
    hint: '请至少填写 1 名同行人员',
    status: '待补充',
    icon: 'mdi mdi-account-group-outline'
  },
  attachments: {
    title: '票据状态',
    hint: '请上传发票/收据等票据附件',
    status: '未上传',
    icon: 'mdi mdi-paperclip'
  }
}

export const REVIEW_FALLBACK_GROUP_CODES = [
  'other',
  'travel',
  'transport',
  'hotel',
  'meal',
  'meeting',
  'marketing',
  'office',
  'training',
  'software',
  'communication',
  'welfare'
]

export const REVIEW_CATEGORY_PRESET_OPTIONS = [
  { key: 'travel', label: '差旅费' },
  { key: 'transport', label: '交通费' },
  { key: 'hotel', label: '住宿费' },
  { key: 'meal', label: '业务招待费' },
  { key: 'office', label: '办公用品费' },
  { key: 'other_trigger', label: '其他类型', is_other: true }
]

export const REVIEW_OTHER_CATEGORY_OPTIONS = [
  { key: 'meeting', label: '会务费' },
  { key: 'marketing', label: '市场推广费' },
  { key: 'training', label: '培训费' },
  { key: 'software', label: '软件服务费' },
  { key: 'communication', label: '通讯费' },
  { key: 'welfare', label: '福利费' },
  { key: 'other', label: '其他费用' }
]

export const REVIEW_SCENE_OTHER_OPTION = '其他场景'

export const REVIEW_SCENE_OPTIONS = ['请客户吃饭', '出差行程', '住宿报销', '交通出行', '会务活动', REVIEW_SCENE_OTHER_OPTION]

export const EXPENSE_CODE_TO_PRESET_SCENE = {
  travel: '出差行程',
  hotel: '住宿报销',
  transport: '交通出行',
  meeting: '会务活动',
  entertainment: '请客户吃饭',
  meal: '请客户吃饭'
}

export const DATE_INPUT_FORMAT = 'YYYY-MM-DD'

export const CATEGORY_CONFIDENCE_KEYWORDS = {
  travel: [/出差|差旅|行程|机票|火车|高铁|航班/],
  hotel: [/住宿|酒店|宾馆|民宿/],
  transport: [TRANSPORT_KEYWORD_PATTERN],
  meal: [/业务招待|招待|宴请|请客|请客户|客户.*吃饭|商务用餐|陪同|餐费|用餐|午餐|晚餐|早餐|伙食|餐饮/],
  meeting: [/会务|会议|论坛|展会|参会|会场/],
  marketing: [/市场推广|推广费|广告|投放|品牌宣传|营销物料|推广物料/],
  entertainment: [/招待|宴请|请客|请客户|客户.*吃饭|商务用餐|陪同/],
  office: [/办公|工位|耗材|白板|键盘|鼠标|打印|文具|采购/],
  training: [/培训|授课|讲师|课程|签到|讲义/],
  software: [/软件|SaaS|订阅|系统服务|云服务|云资源|平台服务|技术服务/],
  communication: [/通讯|电话|流量|话费|宽带|网络/],
  welfare: [/福利|体检|团建|节日|慰问|关怀/]
}
