Files
order_site/apps/frontend/src/utils/admin-webhook.ts
T
2026-04-08 16:30:42 +08:00

23 lines
645 B
TypeScript

import { formatStatusWithRaw } from '@/utils/admin-display'
export function formatAdminWebhookEventType(eventType: string) {
const normalized = String(eventType || '').trim()
if (!normalized) {
return '-'
}
const labelMap: Record<string, string> = {
payment_success: '支付成功',
trade_create: '订单创建',
trade_closed: '订单关闭',
buyer_confirm_goods: '确认收货',
auto_delivery_done: '自动发货完成',
auto_delivery_confirmed: '自动发货确认完成',
refund_apply: '买家申请退款',
trade_event: '交易事件',
}
return formatStatusWithRaw(normalized, labelMap)
}