添加订单押金暂扣与归还

This commit is contained in:
yml2213
2026-07-05 19:35:57 +08:00
parent 9ef0843eb0
commit 090a90a268
17 changed files with 587 additions and 36 deletions
@@ -36,6 +36,11 @@ export interface Order {
settlement_status: SettlementStatus
refund_status?: string
refund_amount_cent?: number
deposit_hold_status?: string
deposit_hold_amount_cent?: number
deposit_hold_reason?: string
deposit_held_at?: string
deposit_hold_released_at?: string
active_dispute?: ActiveDispute
checkout?: Checkout
admin_actions?: AdminActions
@@ -387,6 +392,22 @@ export async function adminRejectRefund(id: number, action: 'restore' | 'close')
return data.data
}
export async function adminHoldDeposit(id: number, reason: string) {
const { data } = await apiClient.post<ApiResponse<{ held: boolean }>>(
`/admin/orders/${id}/deposit-hold`,
{ reason }
)
return data.data
}
export async function adminReleaseDeposit(id: number, reason: string) {
const { data } = await apiClient.post<ApiResponse<{ released: boolean }>>(
`/admin/orders/${id}/deposit-release`,
{ reason }
)
return data.data
}
export async function fetchPendingRefundOrders() {
const { data } = await apiClient.get<ApiResponse<{ items: Order[] }>>(
'/admin/orders/refund-pending'