export const DOCUMENT_TYPE_ALL = 'all'
export const DOCUMENT_TYPE_APPLICATION = 'application'
export const DOCUMENT_TYPE_REIMBURSEMENT = 'reimbursement'
export const DOCUMENT_TYPE_EXPENSE_APPLICATION = 'expense_application'

export const DOCUMENT_TYPE_LABELS = {
  [DOCUMENT_TYPE_APPLICATION]: '申请单',
  [DOCUMENT_TYPE_EXPENSE_APPLICATION]: '申请单',
  [DOCUMENT_TYPE_REIMBURSEMENT]: '报销单'
}

export const INLINE_APPLICATION_STATUS_LABELS = {
  draft: '草稿',
  submitted: '审批中',
  pending: '待处理',
  approved: '已审批',
  completed: '已完成',
  archived: '已归档',
  returned: '已退回',
  rejected: '已驳回',
  pending_payment: '待付款',
  paid: '已付款'
}

export function resolveDocumentTypeLabel(typeCode, fallback = '报销单') {
  const normalized = String(typeCode || '').trim().toLowerCase()
  return DOCUMENT_TYPE_LABELS[normalized] || fallback
}
