const STEWARD_ASSISTANT_NAME = '小财管家'
const STEWARD_DELEGATED_TYPEWRITER_INTERVAL_MS = 10
const STEWARD_DELEGATED_THINKING_INTERVAL_MS = 8
const STEWARD_DELEGATED_TYPEWRITER_CHUNK_SIZE = 4
const STEWARD_DELEGATED_THINKING_CHUNK_SIZE = 5
const APPLICATION_PREVIEW_FIELD_ACTION_SET = 'set_application_preview_field'

const APPLICATION_PREVIEW_ONTOLOGY_FIELD_MAP = {
  applicationType: 'expense_type',
  time: 'time_range',
  location: 'location',
  reason: 'reason',
  amount: 'amount',
  transportMode: 'transport_mode',
  department: 'department_name',
  applicant: 'employee_name',
  grade: 'employee_grade'
}

const APPLICATION_MISSING_LABEL_ONTOLOGY_FIELD_MAP = {
  费用类型: 'expense_type',
  申请类型: 'expense_type',
  发生时间: 'time_range',
  出发时间: 'time_range',
  申请时间: 'time_range',
  地点: 'location',
  事由: 'reason',
  金额: 'amount',
  系统预估费用: 'amount',
  出行方式: 'transport_mode',
  附件: 'attachments',
  '附件/凭证': 'attachments',
  商户: 'merchant_name',
  '商户/开票方': 'merchant_name',
  客户: 'customer_name',
  客户或项目对象: 'customer_name'
}

const ONTOLOGY_FIELD_APPLICATION_PREVIEW_KEY_MAP = {
  expense_type: 'applicationType',
  time_range: 'time',
  location: 'location',
  reason: 'reason',
  amount: 'amount',
  transport_mode: 'transportMode',
  department_name: 'department',
  employee_name: 'applicant',
  employee_grade: 'grade'
}

const ONTOLOGY_FIELD_DISPLAY_LABEL_MAP = {
  expense_type: '费用类型',
  time_range: '时间',
  location: '地点',
  reason: '事由',
  amount: '金额',
  transport_mode: '出行方式',
  attachments: '附件/凭证',
  customer_name: '客户或项目对象',
  merchant_name: '商户/开票方',
  department_name: '所属部门',
  employee_name: '申请人',
  employee_grade: '职级'
}

const APPLICATION_NON_BLOCKING_ONTOLOGY_FIELDS = new Set([
  'amount',
  'attachments',
  'employee_no',
  'department_name',
  'employee_name'
])

const APPLICATION_DUPLICATE_IGNORED_STATUSES = new Set([
  'cancelled',
  'canceled',
  'void',
  'voided',
  'deleted',
  '已取消',
  '已作废',
  '作废',
  '已删除'
])

export {
  APPLICATION_DUPLICATE_IGNORED_STATUSES,
  APPLICATION_MISSING_LABEL_ONTOLOGY_FIELD_MAP,
  APPLICATION_NON_BLOCKING_ONTOLOGY_FIELDS,
  APPLICATION_PREVIEW_FIELD_ACTION_SET,
  APPLICATION_PREVIEW_ONTOLOGY_FIELD_MAP,
  ONTOLOGY_FIELD_APPLICATION_PREVIEW_KEY_MAP,
  ONTOLOGY_FIELD_DISPLAY_LABEL_MAP,
  STEWARD_ASSISTANT_NAME,
  STEWARD_DELEGATED_THINKING_CHUNK_SIZE,
  STEWARD_DELEGATED_THINKING_INTERVAL_MS,
  STEWARD_DELEGATED_TYPEWRITER_CHUNK_SIZE,
  STEWARD_DELEGATED_TYPEWRITER_INTERVAL_MS
}
