新增撞车订单人工退款

This commit is contained in:
yml2213
2026-07-31 21:57:35 +08:00
parent 8c2431c4f2
commit 9511b580e4
13 changed files with 516 additions and 20 deletions
@@ -84,6 +84,20 @@ export interface MohongConfig {
order_copy_template: string
}
export interface MohongRefundResult {
id: number
payment_no: string
order_id: number
order_no: string
biz_type: string
amount_cent: number
status: string
provider_order_id?: string
paid_at?: string | null
created_at: string
updated_at: string
}
export interface Paginated<T> {
items: T[]
total: number
@@ -287,6 +301,17 @@ export async function cancelAdminMohongOrder(id: number, reason?: string) {
return data.data
}
export async function refundAdminMohongOrder(id: number, amountCent?: number, remark?: string) {
const { data } = await apiClient.post<ApiResponse<MohongRefundResult>>(
`/admin/crash/orders/${id}/refund`,
{
amount_cent: Number(amountCent || 0),
remark: remark || '',
}
)
return data.data
}
export async function fetchAdminMohongConfig() {
const { data } = await apiClient.get<ApiResponse<MohongConfig>>('/admin/crash/config')
return data.data