增加客户退税回执确认交互
This commit is contained in:
@@ -33,6 +33,8 @@ export interface MerchantCustomsDocument {
|
||||
inboundCodes: string[]
|
||||
frozen: boolean
|
||||
completion: MerchantCustomsFile | null
|
||||
receiptStatus: 'PENDING' | 'CONFIRMED' | 'REJECTED' | null
|
||||
receiptRejectReason: string | null
|
||||
}
|
||||
|
||||
export interface MerchantCustomsContainer {
|
||||
@@ -47,6 +49,7 @@ export interface MerchantCustomsContainer {
|
||||
version: number
|
||||
taxRefundCount: number
|
||||
coveredTaxRefundCount: number
|
||||
actualBoxCount: number
|
||||
inbounds: MerchantCustomsInbound[]
|
||||
documents: MerchantCustomsDocument[]
|
||||
startedAt?: string | null
|
||||
@@ -190,6 +193,24 @@ export function downloadMerchantCustomsCompletion(document: MerchantCustomsDocum
|
||||
)
|
||||
}
|
||||
|
||||
export function confirmMerchantCustomsReceipt(document: MerchantCustomsDocument) {
|
||||
return apiRequest<MerchantCustomsContainer>({
|
||||
method: 'POST',
|
||||
url: `/merchant/v1/customs/documents/${encodedId(document.documentId)}/receipt/confirm`,
|
||||
headers: { 'Idempotency-Key': createIdempotencyKey(`merchant-customs-receipt-confirm-${document.documentId}`) },
|
||||
data: { expectedVersion: document.completion?.version ?? 0, confirm: true, remark: null },
|
||||
})
|
||||
}
|
||||
|
||||
export function rejectMerchantCustomsReceipt(document: MerchantCustomsDocument, reason: string) {
|
||||
return apiRequest<MerchantCustomsContainer>({
|
||||
method: 'POST',
|
||||
url: `/merchant/v1/customs/documents/${encodedId(document.documentId)}/receipt/reject`,
|
||||
headers: { 'Idempotency-Key': createIdempotencyKey(`merchant-customs-receipt-reject-${document.documentId}`) },
|
||||
data: { expectedVersion: document.completion?.version ?? 0, confirm: false, remark: reason },
|
||||
})
|
||||
}
|
||||
|
||||
export function merchantCustomsErrorMeta(error: unknown): ApiErrorMeta | null {
|
||||
if (!(error instanceof ApiError)) return null
|
||||
return { code: error.code, requestId: error.requestId ?? null, traceId: error.traceId ?? null }
|
||||
|
||||
Reference in New Issue
Block a user