export type ClaimStatus =
  | 'draft'
  | 'pending_submission'
  | 'manager_review'
  | 'finance_review'
  | 'returned'
  | 'approved'
  | 'paid'
  | 'rejected';

export type ClaimAction = 'continue' | 'supplement' | 'submit' | 'approve' | 'return' | 'view';

export type ClaimSummary = {
  id: string;
  claimNo: string;
  title: string;
  amount: number;
  applicant: string;
  submittedAt: string;
  status: ClaimStatus;
  approvalStage: string;
  canEdit: boolean;
  canSupplement: boolean;
};

export const claimStatusMeta: Record<ClaimStatus, { label: string; tone: 'success' | 'warning' | 'danger' | 'info' | 'muted' }> = {
  draft: { label: '草稿', tone: 'warning' },
  pending_submission: { label: '待提交', tone: 'warning' },
  manager_review: { label: '主管审批中', tone: 'success' },
  finance_review: { label: '财务复核中', tone: 'info' },
  returned: { label: '待补充', tone: 'warning' },
  approved: { label: '已通过', tone: 'success' },
  paid: { label: '已打款', tone: 'success' },
  rejected: { label: '已驳回', tone: 'danger' },
};

export function formatMoney(value: number) {
  return `¥${value.toLocaleString('zh-CN', { minimumFractionDigits: 0, maximumFractionDigits: 2 })}`;
}
