start
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
import type { EscortListResult, EscortRecord, PaymentStatusResult } from '~/types/api'
|
||||
import { request } from '~/utils/request'
|
||||
|
||||
export type EscortListQuery = {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
status?: string
|
||||
cancelStatus?: string
|
||||
paymentStatus?: string
|
||||
payChannel?: string
|
||||
startDate?: string
|
||||
endDate?: string
|
||||
appointmentDate?: string
|
||||
keyword?: string
|
||||
userId?: string
|
||||
healthProfileId?: string
|
||||
includeCancelled?: string
|
||||
}
|
||||
|
||||
export const escortApi = {
|
||||
list: (query: EscortListQuery) =>
|
||||
request<EscortListResult>('/health/escort-record', { query }),
|
||||
|
||||
detail: (id: string) =>
|
||||
request<{ record: EscortRecord }>(`/health/escort-record/${id}`),
|
||||
|
||||
update: (id: string, body: Record<string, unknown>) =>
|
||||
request<{ record: EscortRecord }>(`/health/escort-record/${id}`, {
|
||||
method: 'PUT',
|
||||
body,
|
||||
}),
|
||||
|
||||
updateStatus: (id: string, status: string, reason?: string) =>
|
||||
request<{ record: EscortRecord; deleted?: boolean }>(`/health/escort-record/${id}/status`, {
|
||||
method: 'PATCH',
|
||||
body: { status, reason },
|
||||
}),
|
||||
|
||||
remove: (id: string) =>
|
||||
request<{ record: EscortRecord }>(`/health/escort-record/${id}`, {
|
||||
method: 'DELETE',
|
||||
}),
|
||||
|
||||
payStatus: (id: string) =>
|
||||
request<PaymentStatusResult>(`/health/escort-record/${id}/pay/status`),
|
||||
|
||||
refundQuery: (id: string) =>
|
||||
request<{ refund: Record<string, unknown>; paymentStatus: string }>(
|
||||
`/health/escort-record/${id}/refund/query`,
|
||||
{ method: 'POST' }
|
||||
),
|
||||
|
||||
refundManual: (id: string) =>
|
||||
request<{ record: EscortRecord }>(`/health/escort-record/${id}/refund/manual`, {
|
||||
method: 'POST',
|
||||
}),
|
||||
}
|
||||
Reference in New Issue
Block a user