feat(delivery): let customers read and download signed receipts

This commit is contained in:
2026-09-30 12:09:22 +08:00
parent fa9bfd5f97
commit 6abb8b7388
4 changed files with 127 additions and 12 deletions
@@ -1,4 +1,31 @@
import { apiRequest } from '@/api/http'
import { apiBlobRequest, apiRequest } from '@/api/http'
export interface DeliveryReceiptFile {
fileId: string
fileName: string
contentType: string | null
sizeBytes: number
uploadedAt: string
}
export interface DeliveryReceipts {
deliveryNo: string
files: DeliveryReceiptFile[]
}
export function getDeliveryReceipts(deliveryNo: string) {
return apiRequest<DeliveryReceipts>({
method: 'GET',
url: `/merchant/v1/last-leg/delivery-orders/${encodeURIComponent(deliveryNo)}/documents/receipt`,
})
}
export function downloadDeliveryReceipt(deliveryNo: string, fileId: string) {
return apiBlobRequest({
method: 'GET',
url: `/merchant/v1/last-leg/delivery-orders/${encodeURIComponent(deliveryNo)}/documents/receipt/files/${encodeURIComponent(fileId)}/download`,
})
}
export interface PageResult<T> {
records: T[]