This commit is contained in:
2026-08-12 14:08:33 +08:00
parent 4fb8b85c13
commit 975e0057e3
20 changed files with 378 additions and 29 deletions
+18
View File
@@ -7,6 +7,7 @@ import type {
ConfirmedPackageCountRequest,
SaveInboundMeasurementDraftRequest,
SubmitInboundMeasurementRequest,
ManualCartonScanRequest,
} from './types'
function measurementPath(inboundId: string) {
@@ -67,6 +68,23 @@ export async function submitInboundMeasurement(
return unwrapApiResponse(response)
}
export async function createManualCartonScan(
customerId: string,
inboundId: string,
payload: ManualCartonScanRequest,
image: File,
) {
const data = new FormData()
data.append('data', new Blob([JSON.stringify(payload)], { type: 'application/json' }))
data.append('image', image)
const response = await http.post<ApiEnvelope<CartonMeasurementResult>, ApiEnvelope<CartonMeasurementResult>>(
`${measurementPath(inboundId)}/carton-scans`,
data,
{ params: { tenantId: customerId }, headers: { 'Content-Type': 'multipart/form-data' } },
)
return unwrapApiResponse(response)
}
export function downloadInboundMeasurementImage(customerId: string, inboundId: string, fileId: string) {
return http.get<Blob, Blob>(
`/platform/v1/files/measurements/${segment(customerId)}/${segment(inboundId)}/${segment(fileId)}`,